JetBrains / markdown

Markdown parser written in kotlin
Apache License 2.0
682 stars 75 forks source link

Cannot escape any characters using backslash #46

Open BarkingBad opened 4 years ago

BarkingBad commented 4 years ago

Escaping restricted element using backslash actually returns single LeafASTNode:TEXT with all characters within range (with backslash particularly)

So for input aaa\*bbb I expect these AST nodes: 4 leafs splitted something like that LeafASTNode:TEXT, LeafASTNode:Escape, LeafASTNode:Asterisk, LeafASTNode:TEXT, so I can process the Asterisk

ajalt commented 4 years ago

I ran into this as well. Here's the spec: https://spec.commonmark.org/0.29/#backslash-escapes

There actually is an ESCAPED_BACKTICKS node, but none of the other characters are escaped. I'd like to see ESCAPED_BACKTICKS replaced with a more general ESCAPED_CHARACTER rather than have a separate node type for each character.