mity / md4c

C Markdown parser. Fast. SAX-like interface. Compliant to CommonMark specification.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Strikethrough with punctuation special case

step- opened this issue · comments

commented

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:

  • md2html release-0.5.1-46-g3848bfb
  • cmark-gfm 0.29.0.gfm.13

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.

commented

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