mirror of
https://github.com/markedjs/marked.git
synced 2026-11-30 16:48:05 +01:00
fix: respect tab stops in list continuation indentation (#4119)
* fix: respect tab stops in list continuation indentation * test: move tab-stop regressions to spec fixtures
This commit is contained in:
+1
-1
@@ -386,7 +386,7 @@ export class _Tokenizer<ParserOutput = string, RendererOutput = string> {
|
||||
nextLine = nextLine.replace(this.rules.other.listReplaceNesting, ' ');
|
||||
nextLineWithoutTabs = nextLine;
|
||||
} else {
|
||||
nextLineWithoutTabs = nextLine.replace(this.rules.other.leadingSpaceTab, whitespace => whitespace.replace(this.rules.other.tabCharGlobal, ' '));
|
||||
nextLineWithoutTabs = nextLine.replace(this.rules.other.leadingSpaceTab, whitespace => expandTabs(whitespace));
|
||||
}
|
||||
|
||||
// End list item if found code fences
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
<ul>
|
||||
<li><p>foo</p>
|
||||
<p> bar</p>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -0,0 +1,6 @@
|
||||
---
|
||||
gfm: false
|
||||
---
|
||||
- foo
|
||||
|
||||
bar
|
||||
@@ -0,0 +1,5 @@
|
||||
<ul>
|
||||
<li><p>foo</p>
|
||||
<p> bar</p>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -0,0 +1,6 @@
|
||||
---
|
||||
gfm: true
|
||||
---
|
||||
- foo
|
||||
|
||||
bar
|
||||
@@ -0,0 +1,6 @@
|
||||
<ul>
|
||||
<li><p>foo</p>
|
||||
<pre><code> bar
|
||||
</code></pre>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -0,0 +1,6 @@
|
||||
---
|
||||
gfm: false
|
||||
---
|
||||
- foo
|
||||
|
||||
bar
|
||||
@@ -0,0 +1,6 @@
|
||||
<ul>
|
||||
<li><p>foo</p>
|
||||
<pre><code> bar
|
||||
</code></pre>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -0,0 +1,6 @@
|
||||
---
|
||||
gfm: true
|
||||
---
|
||||
- foo
|
||||
|
||||
bar
|
||||
@@ -0,0 +1,5 @@
|
||||
<ul>
|
||||
<li><p>foo</p>
|
||||
<p> bar baz</p>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -0,0 +1,6 @@
|
||||
---
|
||||
gfm: false
|
||||
---
|
||||
- foo
|
||||
|
||||
bar baz
|
||||
@@ -0,0 +1,5 @@
|
||||
<ul>
|
||||
<li><p>foo</p>
|
||||
<p> bar baz</p>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -0,0 +1,6 @@
|
||||
---
|
||||
gfm: true
|
||||
---
|
||||
- foo
|
||||
|
||||
bar baz
|
||||
@@ -0,0 +1,9 @@
|
||||
<ul>
|
||||
<li>outer<ul>
|
||||
<li><p>foo</p>
|
||||
<pre><code>bar
|
||||
</code></pre>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -0,0 +1,7 @@
|
||||
---
|
||||
gfm: false
|
||||
---
|
||||
- outer
|
||||
- foo
|
||||
|
||||
bar
|
||||
@@ -0,0 +1,9 @@
|
||||
<ul>
|
||||
<li>outer<ul>
|
||||
<li><p>foo</p>
|
||||
<pre><code>bar
|
||||
</code></pre>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -0,0 +1,7 @@
|
||||
---
|
||||
gfm: true
|
||||
---
|
||||
- outer
|
||||
- foo
|
||||
|
||||
bar
|
||||
@@ -0,0 +1,5 @@
|
||||
<ol>
|
||||
<li><p>foo</p>
|
||||
<p> bar</p>
|
||||
</li>
|
||||
</ol>
|
||||
@@ -0,0 +1,6 @@
|
||||
---
|
||||
gfm: false
|
||||
---
|
||||
1. foo
|
||||
|
||||
bar
|
||||
@@ -0,0 +1,5 @@
|
||||
<ol>
|
||||
<li><p>foo</p>
|
||||
<p> bar</p>
|
||||
</li>
|
||||
</ol>
|
||||
@@ -0,0 +1,6 @@
|
||||
---
|
||||
gfm: true
|
||||
---
|
||||
1. foo
|
||||
|
||||
bar
|
||||
@@ -0,0 +1,5 @@
|
||||
<ul>
|
||||
<li><p>foo</p>
|
||||
<p> bar</p>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -0,0 +1,6 @@
|
||||
---
|
||||
gfm: false
|
||||
---
|
||||
- foo
|
||||
|
||||
bar
|
||||
@@ -0,0 +1,5 @@
|
||||
<ul>
|
||||
<li><p>foo</p>
|
||||
<p> bar</p>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -0,0 +1,6 @@
|
||||
---
|
||||
gfm: true
|
||||
---
|
||||
- foo
|
||||
|
||||
bar
|
||||
@@ -0,0 +1,5 @@
|
||||
<ol start="10">
|
||||
<li><p>foo</p>
|
||||
<p>bar</p>
|
||||
</li>
|
||||
</ol>
|
||||
@@ -0,0 +1,6 @@
|
||||
---
|
||||
gfm: false
|
||||
---
|
||||
10. foo
|
||||
|
||||
bar
|
||||
@@ -0,0 +1,5 @@
|
||||
<ol start="10">
|
||||
<li><p>foo</p>
|
||||
<p>bar</p>
|
||||
</li>
|
||||
</ol>
|
||||
@@ -0,0 +1,6 @@
|
||||
---
|
||||
gfm: true
|
||||
---
|
||||
10. foo
|
||||
|
||||
bar
|
||||
Reference in New Issue
Block a user