Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/inlines.c
Original file line number Diff line number Diff line change
Expand Up @@ -342,8 +342,10 @@ static bufsize_t scan_to_closing_backticks(subject *subj,
advance(subj);
numticks++;
}
// store position of ender
if (numticks <= MAXBACKTICKS) {
// store position of ender (keep the last one: a scan that resumes after
// an earlier full scan must not replace a later position)
if (numticks <= MAXBACKTICKS &&
subj->backticks[numticks] < subj->pos - numticks) {
subj->backticks[numticks] = subj->pos - numticks;
}
if (numticks == openticklength) {
Expand Down
13 changes: 13 additions & 0 deletions test/regression.txt
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,19 @@ x <- 1
</code></pre>
````````````````````````````````

Code spans after an unmatched backtick string of a different length.
The failed scan for the closer of ``` `` ``` must not hide the second
single-backtick span.
```````````````````````````````` example
``x
`i`
`j`
.
<p>``x
<code>i</code>
<code>j</code></p>
````````````````````````````````

https://github.com/commonmark/commonmark.js/issues/283
```````````````````````````````` example
x<!x>
Expand Down
Loading