-
-
Notifications
You must be signed in to change notification settings - Fork 145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Number/hash sign (#) is escaped #509
Comments
Hi! This is part of the CommonMark escaping strategy we inherited from our upstream. There's some truly ancient code in there; just now I The extant strategy is that, in regular text, we simply always escape a bunch of characters, hash Lines 202 to 222 in 8d1e90c
We obviously can be smarter about this, but it requires a bit more intelligence than the formatter currently provides for (viz. almost none — right now the function outputting a character has no context whatsoever). Would you be willing to try submitting a PR to fix this? An acceptable minimal improvement would, for instance, pass through |
Hey, yes that was my initial idea here, to match on string there instead of a char and the string would be Thanks, I'll make a PR today |
I'm afraid it goes deeper, even exclamation marks are escaped |
Yes, if you look at the code snippet I've quoted above, quite a lot of things are escaped — anything that could form part of valid markup. (For exclamation mark |
Hey, I'm using comrak to build an app on top of markdown-oxide, that uses tags
#like
#this
;Tweaking a source AST and writing it back to original files works great, however, tags are unnecessarily rewritten as
\#this
.If it's about distinguishing from headers, those require a whitespace between sign and title, so this escape seems redundant, other than that I don't know why it could be needed
The text was updated successfully, but these errors were encountered: