diff --git a/src/Tokenizer.js b/src/Tokenizer.js index 6889d7b145..9e2866f2b2 100644 --- a/src/Tokenizer.js +++ b/src/Tokenizer.js @@ -203,7 +203,7 @@ export class Tokenizer { raw = cap[0]; src = src.substring(raw.length); - line = cap[2].split('\n', 1)[0]; + line = cap[2].split('\n', 1)[0].replace(/^\t+/, (t) => ' '.repeat(3 * t.length)); nextLine = src.split('\n', 1)[0]; if (this.options.pedantic) { @@ -225,7 +225,7 @@ export class Tokenizer { } if (!endEarly) { - const nextBulletRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:[*+-]|\\d{1,9}[.)])((?: [^\\n]*)?(?:\\n|$))`); + const nextBulletRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`); const hrRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`); const fencesBeginRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:\`\`\`|~~~)`); const headingBeginRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}#`); diff --git a/test/specs/new/list_item_tabs.html b/test/specs/new/list_item_tabs.html new file mode 100644 index 0000000000..e1b33013ea --- /dev/null +++ b/test/specs/new/list_item_tabs.html @@ -0,0 +1,17 @@ +