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: 2 additions & 2 deletions src/rules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,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
Expand Down Expand Up @@ -124,7 +124,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();

Expand Down
14 changes: 14 additions & 0 deletions test/specs/new/list_item_empty.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<ul>
<li>
<h2>title</h2>
</li>
</ul>
<hr />
<ul>
<li>title
<ul>
<li>desc</li>
<li></li>
</ul>
</li>
</ul>
8 changes: 8 additions & 0 deletions test/specs/new/list_item_empty.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
- title
-

---

- title
- desc
-