cmark
cmark copied to clipboard
A***B*C* doesn't roundtrip
See https://github.com/kivikakk/comrak/issues/111 -- the string A***B*C* doesn't roundtrip correctly. It's not exactly well-formed, but ideally we should be consistent.
See https://github.com/kivikakk/comrak/issues/111 -- the string
A***B*C*doesn't roundtrip correctly. It's not exactly well-formed, but ideally we should be consistent.
This one is really tricky to get right, because the
behavior turns on the "multiple of 3" rule. That
first asterisk is literal, so the writer
backslash-escapes it, but that changes the initial
delimiter run from *** to **, and now it can't
form emphasis because of the "multiple of 3" rule.
Argh!
It's hard to see how the writer can know it's safe to leave out the backslash without actually parsing its candidate rendering and comparing the result. Maybe that approach could be considered, though, since efficiency presumably isn't as important for generating commonmark as it is for generating HTML.
See also #131.