remark incorrectly parses emphasis markers that span an inline code fence in certain cases.
aa_bb `aa_ bb` parses _bb `aa_ as a single emphasis block instead of respecting the inline code marker.
aa_bb `aa _bb` is parsed correctly with no emphasis.
Relatedly, aa**bb `aa**bb` is also incorrectly parsed in a similar way. My suspicion is that these would be related bugs, but I can open a separate issue if not.
I haven't looked into where I think this is being caused but I'll take a look later today and see if I can't uncover it.
See the astexplorer example from above: https://astexplorer.net/#/gist/07d9ecadf011d35e45b47e73ff91edf8/1dc9657f969f4723440e250bcbf0c2b6e441d1ea
Run aa_bb `aa_ bb` through the parser.
You should receive the following pseudo-AST:
text: "aa_bb"
inlineCode: "aa_ bb"
You receive the following psudo-AST:
text: "aa"
emphasis: "bb `aa"
text: "bb"
Thanks for reporting this @saramarcondes n please keep on reporting anything you find, and great that remark in prettier is getting an upgrade!
I'm currently hard at work again working on a new markdown parser under remark, micromark, which still has lots more to do, but does include this fix!
@wooorm Thanks for letting me know! I look forward to updating prettier again when micromark is ready 馃榿 Thanks for all the hard work!
Heya, just wanted to give an update about micromark, it鈥檚 sort-of a new motor that we鈥檒l soon use in remark to parse markdown. It鈥檚 not yet 100% ready but will be relatively soon. The good news is, it fixes this issue! (P.S. see this twitter thread for some more info!)
Sorry for the wait! I just wanted to share that there鈥檚 now a PR that solves this issue: https://github.com/remarkjs/remark/pull/536.
This is now released in [email protected]
Most helpful comment
Sorry for the wait! I just wanted to share that there鈥檚 now a PR that solves this issue: https://github.com/remarkjs/remark/pull/536.