You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Number Duplicate Inline Comments Correctly Past a Stray Backtick #3429
The inline Markdown comment search blanks code spans with CODE_SPAN before searching, which does not follow CommonMark's precedence rules. A stray backtick (backslash-escaped, inside a comment's own text, in an HTML attribute, or in an autolink) pairs with a later backtick and blanks the stretch between them. Where the first of two comments with identical text falls inside that stretch, the search skips it and numbers both on the later line.
Reproduction (constructed)
Start \` and <!-- x --> one
then \` and
later <!-- x --> two.
The two comments are numbered 1 and 3 by the raw search that preceded the code-span mask, and 3 and 3 by the masked search. The second copy must sit mid-line, since one at the start of a line is an html_block.
What fixing it needs
Code-span positions taken from the Markdown parser rather than a regex, or a search that accepts a masked hit only where the raw line agrees and the comment is not inside a real span. Rare: it needs a stray backtick and two comments with the same text in one paragraph.
Activity
Lex Heredoc Bodies Apart and Skip Code Spans When Numbering Inline Co…
Promote the markdown-it Shared Reader, Heredoc Lexing, and Exit-42 Fi…
Read Digit-Labelled and Second Heredocs, Skip Non-Shell Run Splits, a…
Lex Each of Two Heredoc Bodies Alone and Keep Autolinks Out of the Co…