Skip to content

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.

@kivikakk
Copy link
Owner

#523 has been merged, which gets us a bit closer to the desired outcome here. Thanks again for your attempt! 🧡

@kivikakk kivikakk closed this Feb 21, 2025
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