mirror of
https://github.com/markedjs/marked.git
synced 2026-11-30 16:48:05 +01:00
fix: match html block start conditions when ending a list item (#4072)
This commit is contained in:
+3
-1
@@ -96,7 +96,9 @@ export const other = {
|
||||
hrRegex: cachedIndentRegex((indent: number) => new RegExp(`^ {0,${indent}}((?:-[ \t]*){3,}|(?:_[ \t]*){3,}|(?:\\*[ \t]*){3,})(?:\\n+|$)`)),
|
||||
fencesBeginRegex: cachedIndentRegex((indent: number) => new RegExp(`^ {0,${indent}}(?:\`\`\`|~~~)`)),
|
||||
headingBeginRegex: cachedIndentRegex((indent: number) => new RegExp(`^ {0,${indent}}#`)),
|
||||
htmlBeginRegex: cachedIndentRegex((indent: number) => new RegExp(`^ {0,${indent}}<(?:[a-z].*>|!--)`, 'i')),
|
||||
// a list item ends where a paragraph would be interrupted, so this mirrors the
|
||||
// html start conditions in the paragraph rule below; type 7 is excluded there
|
||||
htmlBeginRegex: cachedIndentRegex((indent: number) => new RegExp(`^ {0,${indent}}(?:</?(?:${_tag})(?: +|$|/?>)|<(?:script|pre|style|textarea|!--))`, 'i')),
|
||||
blockquoteBeginRegex: cachedIndentRegex((indent: number) => new RegExp(`^ {0,${indent}}>`)),
|
||||
};
|
||||
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
<div class="some-class">
|
||||
<ul>
|
||||
<li>list item 1</li>
|
||||
<li>list item 2</li>
|
||||
</ul>
|
||||
</div>
|
||||
@@ -0,0 +1,5 @@
|
||||
<div class="some-class">
|
||||
|
||||
- list item 1
|
||||
- list item 2
|
||||
</div>
|
||||
@@ -0,0 +1,6 @@
|
||||
<ul>
|
||||
<li>list item 1
|
||||
<b>bold</b></li>
|
||||
<li>list item 2
|
||||
<span>span</span></li>
|
||||
</ul>
|
||||
@@ -0,0 +1,4 @@
|
||||
- list item 1
|
||||
<b>bold</b>
|
||||
- list item 2
|
||||
<span>span</span>
|
||||
@@ -0,0 +1,8 @@
|
||||
<ul>
|
||||
<li>list item 1</li>
|
||||
<li>list item 2</li>
|
||||
</ul>
|
||||
<div
|
||||
class="some-class">
|
||||
Content
|
||||
</div>
|
||||
@@ -0,0 +1,6 @@
|
||||
- list item 1
|
||||
- list item 2
|
||||
<div
|
||||
class="some-class">
|
||||
Content
|
||||
</div>
|
||||
Reference in New Issue
Block a user