From 6355ac2d6fb7b8c00697e30f93135df351cf7089 Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Wed, 21 Oct 2020 09:38:23 -0500 Subject: [PATCH] fix: fix indented code in list item (#1762) --- src/Tokenizer.js | 2 +- test/specs/commonmark/commonmark.0.29.json | 3 +-- test/specs/gfm/commonmark.0.29.json | 3 +-- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/Tokenizer.js b/src/Tokenizer.js index 126cfb2f70..923d578aeb 100644 --- a/src/Tokenizer.js +++ b/src/Tokenizer.js @@ -226,7 +226,7 @@ module.exports = class Tokenizer { // Remove the list item's bullet // so it is seen as the next token. space = item.length; - item = item.replace(/^ *([*+-]|\d+[.)]) */, ''); + item = item.replace(/^ *([*+-]|\d+[.)]) ?/, ''); // Outdent whatever the // list item contains. Hacky. diff --git a/test/specs/commonmark/commonmark.0.29.json b/test/specs/commonmark/commonmark.0.29.json index fb5ef5805a..157cc91cd6 100644 --- a/test/specs/commonmark/commonmark.0.29.json +++ b/test/specs/commonmark/commonmark.0.29.json @@ -53,8 +53,7 @@ "example": 7, "start_line": 424, "end_line": 433, - "section": "Tabs", - "shouldFail": true + "section": "Tabs" }, { "markdown": " foo\n\tbar\n", diff --git a/test/specs/gfm/commonmark.0.29.json b/test/specs/gfm/commonmark.0.29.json index 0074ed958c..9b2a90524c 100644 --- a/test/specs/gfm/commonmark.0.29.json +++ b/test/specs/gfm/commonmark.0.29.json @@ -53,8 +53,7 @@ "example": 7, "start_line": 424, "end_line": 433, - "section": "Tabs", - "shouldFail": true + "section": "Tabs" }, { "markdown": " foo\n\tbar\n",