Cmarker: How to avoid duplicate attribution when nesting quotes?

I am writing a script that automatically converts Markdown to PDF via cmarker: to avoid the problem mentioned in the title, I have come up with this:

#import "@preview/cmarker:0.1.8"
#cmarker.render("
<!--raw-typst #set quote(attribution:\"bob\") -->
> Hello,
<!--raw-typst #set quote(attribution:none) -->
> > world!
> I
> > am
> writing
> > > a
> > > sentence
")

Sadly the attribution appears not when the quote finishes, but when attribution is set to none (so the quote continues after the attribution, instead of ending before it). Can anyone think of a better way?

This sets all attributions inside the outermost quote to none.

#import "@preview/cmarker:0.1.8"
#cmarker.render("
<!--raw-typst #set quote(attribution:\"bob\") -->
<!--raw-typst 
#show quote: it => {
  set quote(attribution: none)
  it
}
-->
> Hello,
> > world!
> I
> > am
> writing
> > > a
> > > sentence
")

2 Likes