Skip to content
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

escape hash only with following whitespace #510

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

fominok
Copy link

@fominok fominok commented Dec 16, 2024

this should fix #509

@kivikakk
Copy link
Owner

Hi! Thanks for this. Unfortunately, it causes the spec tests to fail; see https://github.com/kivikakk/comrak/actions/runs/12358004998/job/34494314497?pr=510.

That's this example:

Backslash-escaped `#` characters do not count as part
of the closing sequence:

```````````````````````````````` example
### foo \###
## foo #\##
# foo \#
.
<h3>foo ###</h3>
<h2>foo ###</h2>
<h1>foo #</h1>
````````````````````````````````

The # characters on the right-hand side are no longer escaped (because there's no following space), and they're treated as part of the ATX heading a result.

It looks like this may be a more complicated fix; in general, it's hard to say whether or not a character needs to be escaped to be preserved without a lot more knowledge in the formatter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Number/hash sign (#) is escaped
2 participants