Marked treats tabs and spaces differently in lists #3126
Labels
category: lists
L2 - annoying
Similar to L1 - broken but there is a known workaround available for the issue
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:
Marked Demo
https://marked.js.org/demo/?text=I%20am%20using%20spaces%20after%20the%20number%3A%0A1.%20%20Some%20Text%0A2.%20%20Some%20Text%0A3.%20%20Some%20Text%0A%0AI%20am%20using%20tabs%20after%20the%20number%3A%0A1.%09SomeText%0A2.%09SomeText%0A3.%09SomeText%0A%0AI%20am%20using%20tabs%20after%20the%20number%20and%20have%20a%20space%3A%0A%0A1.%09SomeText%0A2.%09SomeText%0A3.%09SomeText%0A%0AI%20am%20using%20spaces%20after%20the%20number%3A%0A-%20%20Some%20Text%0A-%20%20Some%20Text%0A-%20%20Some%20Text%0A%0AI%20am%20using%20tabs%20after%20the%20number%3A%0A-%09SomeText%0A-%09SomeText%0A-%09SomeText%0A%0AI%20am%20using%20tabs%20after%20the%20number%20and%20have%20a%20space%3A%0A%0A-%09SomeText%0A-%09SomeText%0A-%09SomeText%0A&options=%7B%0A%20%22async%22%3A%20false%2C%0A%20%22breaks%22%3A%20false%2C%0A%20%22extensions%22%3A%20null%2C%0A%20%22gfm%22%3A%20true%2C%0A%20%22hooks%22%3A%20null%2C%0A%20%22pedantic%22%3A%20false%2C%0A%20%22silent%22%3A%20false%2C%0A%20%22tokenizer%22%3A%20null%2C%0A%20%22walkTokens%22%3A%20null%0A%7D&version=11.0.0
CommonMark Demo
https://spec.commonmark.org/dingus/?text=I%20am%20using%20spaces%20after%20the%20number%3A%0A1.%20%20Some%20Text%0A2.%20%20Some%20Text%0A3.%20%20Some%20Text%0A%0AI%20am%20using%20tabs%20after%20the%20number%3A%0A1.%09SomeText%0A2.%09SomeText%0A3.%09SomeText%0A%0AI%20am%20using%20tabs%20after%20the%20number%20and%20have%20a%20space%3A%0A%0A1.%09SomeText%0A2.%09SomeText%0A3.%09SomeText%0A%0AI%20am%20using%20spaces%20after%20the%20number%3A%0A-%20%20Some%20Text%0A-%20%20Some%20Text%0A-%20%20Some%20Text%0A%0AI%20am%20using%20tabs%20after%20the%20number%3A%0A-%09SomeText%0A-%09SomeText%0A-%09SomeText%0A%0AI%20am%20using%20tabs%20after%20the%20number%20and%20have%20a%20space%3A%0A%0A-%09SomeText%0A-%09SomeText%0A-%09SomeText%0A
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.
The text was updated successfully, but these errors were encountered: