mirror of
https://github.com/markedjs/marked.git
synced 2026-11-30 16:48:05 +01:00
fix: fix empty list item (#3890)
This commit is contained in:
+2
-2
@@ -97,7 +97,7 @@ const blockCode = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/;
|
||||
const fences = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/;
|
||||
const hr = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/;
|
||||
const heading = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/;
|
||||
const bullet = /(?:[*+-]|\d{1,9}[.)])/;
|
||||
const bullet = / {0,3}(?:[*+-]|\d{1,9}[.)])/;
|
||||
const lheadingCore = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/;
|
||||
const lheading = edit(lheadingCore)
|
||||
.replace(/bull/g, bullet) // lists can interrupt
|
||||
@@ -125,7 +125,7 @@ const def = edit(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +
|
||||
.replace('title', /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/)
|
||||
.getRegex();
|
||||
|
||||
const list = edit(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/)
|
||||
const list = edit(/^(bull)([ \t][^\n]+?)?(?:\n|$)/)
|
||||
.replace(/bull/g, bullet)
|
||||
.getRegex();
|
||||
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
<ul>
|
||||
<li>
|
||||
<h2>title</h2>
|
||||
</li>
|
||||
</ul>
|
||||
<hr />
|
||||
<ul>
|
||||
<li>title
|
||||
<ul>
|
||||
<li>desc</li>
|
||||
<li></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -0,0 +1,8 @@
|
||||
- title
|
||||
-
|
||||
|
||||
---
|
||||
|
||||
- title
|
||||
- desc
|
||||
-
|
||||
Reference in New Issue
Block a user