Closed abarsov closed 2 years ago
Fixed in #100
Parsing of the string **~~b**~~
still fails with another exception though:
"MarkdownParsingException: Intersecting parsed nodes detected: Node(range=2..9, type=Markdown:STRIKETHROUGH) vs Node(range=0..7, type=Markdown:STRONG)
at Object.captureStack (http://localhost:8000/index.js:63163:15)
at MarkdownParsingException.Exception [as constructor] (http://localhost:8000/index.js:63496:14)
at MarkdownParsingException.RuntimeException [as constructor] (http://localhost:8000/index.js:63522:17)
at MarkdownParsingException.IllegalStateException [as constructor] (http://localhost:8000/index.js:63562:24)
at IllegalStateException_init_0 (http://localhost:8000/index.js:63573:29)
at new MarkdownParsingException (http://localhost:8000/index.js:194111:5)
at InlineBuilder.TreeBuilder.buildTree_3cbhjl$ (http://localhost:8000/index.js:199350:19)
at MarkdownParser.doParseInline_0 (http://localhost:8000/index.js:199028:71)
at MarkdownParser.parseInline_6auev$ (http://localhost:8000/index.js:198985:19)
at MarkdownParser$InlineExpandingASTNodeBuilder.createLeafNodes_1ffi4f$ (http://localhost:8000/index.js:199043:33)"
cc @FirstTimeInForever
It appeared to be a misuse of deprecated API.
Since 0.3.0 one should define the only composite parser in the overridden function MarkdownFlavourDescriptor.sequentialParserManager
of a flavour descriptor:
EmphasisLikeParser(EmphStrongDelimiterParser(), StrikeThroughDelimiterParser())
instead of a pair we used to deifne in previous versions.StrikeThroughParser()
EmphStrongParser()
@FirstTimeInForever Do you think it might be better to provide a different (deprecated) fallback for StrikeThroughParser? E.g. use EmphasisLikeParser(EmphStrongDelimiterParser())
, I think that should alleviate the issue
@valich Unfortunately, I don't see a way of providing a fully working fallbacks for old parsers :(. The problem is, that both parsers for strikethroughs and empasises require a single instance of EmphasisLikeParser
. So, making a EmphasisLikeParser(EmphStrongDelimiterParser())
fallback for old emphasis parser and EmphasisLikeParser(StrikeThroughDelimiterParser())
fallback for strikethrough parser would not work, since they both will be wrapped with different instances of EmphasisLikeParser
.
Content of the following code block (just content without code block itself) being parsed causes AssertionError
**~~b**~~
Expected behaviour: Parser returns a tree with bolded ~~bb followed directly by plain text ~~ Actual result: