mity / md4c

C Markdown parser. Fast. SAX-like interface. Compliant to CommonMark specification.
MIT License
759 stars 140 forks source link

Space trimming in a code span nested in block quote #70

Closed mity closed 5 years ago

mity commented 5 years ago

Currently spaces from code span are not trimmed correctly in this complex case:

> ` this 
> is     
> a long 
> code   
> span   
> `      

It generates:

<blockquote>
<p><code>this is a long code span </code></p>
</blockquote>

(The final space should not be present.)

It works if not nested in a block-quote:

` this   
is       
a long   
code     
span     
`        

(Affects both master and new spec-0.29 branch which does it differently due the new trimming rules.)

mity commented 5 years ago

For spec-0.29, fixed in b7d3c1a37e459d32591a641128b12f4dc3e00cff.

mity commented 5 years ago

Hmm. Fixing in master would require bigger change then I like. Given the 0.29 reworks the code span space trimming rules anyway and that this is sort of corner case, maybe the best strategy is to just live with it until spec-0.29 branch gets merged into master.

mity commented 5 years ago

Fixed by merging spec-0.29 branch into master.