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
6 changes: 6 additions & 0 deletions src/Tokenizer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,7 @@ export class _Tokenizer<ParserOutput = string, RendererOutput = string> {
const fencesBeginRegex = this.rules.other.fencesBeginRegex(indent);
const headingBeginRegex = this.rules.other.headingBeginRegex(indent);
const htmlBeginRegex = this.rules.other.htmlBeginRegex(indent);
const blockquoteBeginRegex = this.rules.other.blockquoteBeginRegex(indent);

// Check if following lines should be included in List Item
while (src) {
Expand Down Expand Up @@ -326,6 +327,11 @@ export class _Tokenizer<ParserOutput = string, RendererOutput = string> {
break;
}

// End list item if found start of blockquote
if (blockquoteBeginRegex.test(nextLine)) {
break;
}
Comment thread
UziTech marked this conversation as resolved.

// End list item if found start of new bullet
if (nextBulletRegex.test(nextLine)) {
break;
Expand Down
1 change: 1 addition & 0 deletions src/rules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ export const other = {
fencesBeginRegex: (indent: number) => new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:\`\`\`|~~~)`),
headingBeginRegex: (indent: number) => new RegExp(`^ {0,${Math.min(3, indent - 1)}}#`),
htmlBeginRegex: (indent: number) => new RegExp(`^ {0,${Math.min(3, indent - 1)}}<(?:[a-z].*>|!--)`, 'i'),
blockquoteBeginRegex: (indent: number) => new RegExp(`^ {0,${Math.min(3, indent - 1)}}>`),
Comment thread
UziTech marked this conversation as resolved.
};

/**
Expand Down
34 changes: 34 additions & 0 deletions test/specs/new/nested_blockquote_in_list.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<h3>Child</h3>
<ul>
<li>list item
<ul>
<li>nested list item
<blockquote>
<p>quoteblock</p>
</blockquote>
</li>
</ul>
</li>
</ul>
<h3>Sibling</h3>
<ul>
<li>list item
<ul>
<li>nested list item</li>
</ul>
<blockquote>
<p>quoteblock</p>
</blockquote>
</li>
</ul>
<h3>Parent level</h3>
<ul>
<li>list item
<ul>
<li>nested list item</li>
</ul>
</li>
</ul>
<blockquote>
<p>quote block</p>
</blockquote>
14 changes: 14 additions & 0 deletions test/specs/new/nested_blockquote_in_list.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
### Child
- list item
- nested list item
> quoteblock

### Sibling
- list item
- nested list item
> quoteblock

### Parent level
- list item
- nested list item
> quote block