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 @@ + + +
    +
  1. A
  2. +
  3. B
  4. +
  5. C
  6. +
  7. D
  8. +
  9. E
  10. +
  11. F
  12. +
diff --git a/test/specs/new/list_item_tabs.md b/test/specs/new/list_item_tabs.md new file mode 100644 index 0000000000..b42c88b8cc --- /dev/null +++ b/test/specs/new/list_item_tabs.md @@ -0,0 +1,13 @@ +- A +- B +- C +- D +- E +- F + +1. A +2. B +3. C +4. D +5. E +6. F