Skip to content
Merged
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
4 changes: 4 additions & 0 deletions src/Lexer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ export class _Lexer<ParserOutput = string, RendererOutput = string> {

for (let i = 0; i < this.inlineQueue.length; i++) {
const next = this.inlineQueue[i];
// an inline <pre>, <code>, <kbd> or <script> left open ends with the block
// holding it; carried over, it would stop every later block's text from
// being escaped
this.state.inRawBlock = false;
this.inlineTokens(next.src, next.tokens);
}
this.inlineQueue = [];
Expand Down
11 changes: 11 additions & 0 deletions test/specs/new/unclosed_inline_raw_tag.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<p>an unclosed <code> tag</p>
<p>does not leak into the next paragraph: 1 &lt; 2 &amp; 3 &gt; 2</p>
<p>an unclosed <pre> tag</p>
<h1>does not leak into a heading: 1 &lt; 2 &amp; 3 &gt; 2</h1>
<p>an unclosed <kbd> tag</p>
<ul>
<li>does not leak into a list item: 1 &lt; 2 &amp; 3 &gt; 2</li>
</ul>
<p>within a paragraph <code>a & b</code> is still raw, as is
<code>a & b
across a line</code> but not after it: 1 &lt; 2</p>
18 changes: 18 additions & 0 deletions test/specs/new/unclosed_inline_raw_tag.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
renderExact: true
---
an unclosed <code> tag

does not leak into the next paragraph: 1 < 2 & 3 > 2

an unclosed <pre> tag

# does not leak into a heading: 1 < 2 & 3 > 2

an unclosed <kbd> tag

- does not leak into a list item: 1 < 2 & 3 > 2

within a paragraph <code>a & b</code> is still raw, as is
<code>a & b
across a line</code> but not after it: 1 < 2
Loading