Skip to content

Commit

Permalink
fix: fix indented code in list item (markedjs#1762)
Browse files Browse the repository at this point in the history
  • Loading branch information
UziTech authored Oct 21, 2020
1 parent 8b9a4a6 commit 6355ac2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/Tokenizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 1 addition & 2 deletions test/specs/commonmark/commonmark.0.29.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@
"example": 7,
"start_line": 424,
"end_line": 433,
"section": "Tabs",
"shouldFail": true
"section": "Tabs"
},
{
"markdown": " foo\n\tbar\n",
Expand Down
3 changes: 1 addition & 2 deletions test/specs/gfm/commonmark.0.29.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@
"example": 7,
"start_line": 424,
"end_line": 433,
"section": "Tabs",
"shouldFail": true
"section": "Tabs"
},
{
"markdown": " foo\n\tbar\n",
Expand Down

0 comments on commit 6355ac2

Please sign in to comment.