wooorm / markdown-rs

CommonMark compliant markdown parser in Rust with ASTs and extensions
https://docs.rs/markdown/1.0.0-alpha.18/markdown/
MIT License
836 stars 41 forks source link

issue 84: GFM strikethrough causes nested attention sequences to be considered just text data #88

Closed rawilder closed 7 months ago

rawilder commented 7 months ago

The original issue I was trying to solve was that a markdown line like this ~~foo __*a*__~~ was not correctly parsed because tilde was not being considered punctuation.

After changing that, the interplay between emphasis and strikethrough started failing because to implement how Github flavors it, we must consider tilde not punctuation when deciding if the sequence is the close. The interplay example is e ***~~xxx~~***yyy

I've added a specific exception for tilde with a comment explaining why it is there.

wooorm commented 7 months ago

Thank you Adam for your work and your patience, that was interesting to solve.

I solved it more similar to how it is done in micromark. I also noticed another bug present here: some ASCII punctuation characters are not Unicode punctuation.