mity / md4c

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

Strikethrough with punctuation special case #246

Closed step- closed 4 months ago

step- commented 4 months ago

Conceptually similar to #242, the last two paragraphs still yield unespected strikethrough markup.

"~u/f" "~v/g"

"~u/.f" "~v/.g"

"~/f" "~/g"

"~/.bashrc" "~/.bash_history"

However, comparing with GFM shows identical output. So, if GFM compatibility is a criterion, there is nothing else left to fix.

Versions compared:

mity commented 4 months ago

In cases like "~/g", the ~ has a punctuation mark at either side. I'm afraid such situations won't ever be fixed unless we would make some too overly complex heuristics, even more detailed than what standard emphasis uses.

Consider putting such paths into code spans, or if you need to avoid that, you'll likely have to escape the tilde characters.

step- commented 4 months ago

I agree with both your remarks. I'm closing this issue leaving the special case documented.