Marked treats tabs and spaces differently in lists #3126
Open
Description
Marked version:
11.0.0
Describe the bug
When writing bulleted or numbered lists, if you have text before the list, tabs get interpreted differently to spaces and causes conversion issues.
To Reproduce
Steps to reproduce the behavior:
- Create a file with the below text, ensure tabs and spaces are in the proper places based on the headings.
I am using spaces after the number:
1. Some Text
3. Some Text
4. Some Text
I am using tabs after the number:
1. SomeText
2. SomeText
3. SomeText
I am using tabs after the number and have a space:
1. SomeText
2. SomeText
3. SomeText
I am using spaces after the number:
- Some Text
- Some Text
- Some Text
I am using tabs after the number:
- SomeText
- SomeText
- SomeText
I am using tabs after the number and have a space:
- SomeText
- SomeText
- SomeText
- Run marked on the file
marked README.md
<p>I am using spaces after the number:</p>
<ol>
<li>Some Text</li>
<li>Some Text</li>
<li>Some Text</li>
</ol>
<p>I am using tabs after the number:
1. SomeText
2. SomeText
3. SomeText</p>
<p>I am using tabs after the number and have a space:</p>
<ol>
<li> SomeText</li>
<li> SomeText</li>
<li> SomeText</li>
</ol>
<p>I am using spaces after the number:</p>
<ul>
<li>Some Text</li>
<li>Some Text</li>
<li>Some Text</li>
</ul>
<p>I am using tabs after the number:
- SomeText
- SomeText
- SomeText</p>
<p>I am using tabs after the number and have a space:</p>
<ul>
<li> SomeText</li>
<li> SomeText</li>
<li> SomeText</li>
</ul>
Expected behavior
The lists with tabs should be interpreted the same regardless of any text placed before them.
Additional
The markdown given above displays correctly in both GitHub as well as VS Code's markdown previewer implying marked is having an issue interpreting the tabs correctly.