Unnecessary escape for # character #105
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
According to the CommonMark spec,
#that is not followed by spaces, tabs, or the end of line, would not become headings.Example:
https://spec.commonmark.org/dingus/?text=%23%20abc%20(heading)%0A%0A%23abc%20(not%20heading)%0A%0A%23%0A(%E2%86%91%20empty%20heading)%0A
But the serializer of
prosemirror-markdownescapes#even if the text would not be parsed as headings. e.g.would be serialized back to
making the generated Markdown less clean and less readable.
Solution
Given my previous experience with #101, I wonder if this can be solved by changing the regular expressions in the
escfunction a bit.Yes, this sounds like it could also be fixed by not matching these characters if they are followed by non-whitespace. Want to submit a PR?
Sure! I'll try.