MichaelHatherly / CommonMark.jl

A CommonMark-compliant Markdown parser for Julia.
Other
84 stars 11 forks source link

Interpolate a vector of items #30

Closed fonsp closed 2 years ago

fonsp commented 2 years ago

The @md_str from Markdown, and the @htl macro from https://github.com/MechanicalRabbit/HypertextLiteral.jl will render items one-by-one if you interpolate a vector or generator:

Schermafbeelding 2021-12-16 om 12 37 31

worlds = [HTML("<div>world $i</div>") for i in 1:3]

The @cm_str macro renders the vector itself. Is this intentional? Is there another way to render all items? (My solution right now is to wrap the array in @htl("$(worlds)") to turn it into a single HTML renderable.

MichaelHatherly commented 2 years ago

Yeah, probably just matching what md does here is most reasonable.

MichaelHatherly commented 2 years ago

Fixed in #32.