Skip to content

Commit 67b79c1

Browse files
committed
fix: update regex for table parsing in Parser.js and Parser.coffee
1 parent eb9cb21 commit 67b79c1

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

Parser.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
},
88
"license": "BSD-4-Clause",
99
"author": "SegmentFault",
10-
"version": "2.4.29",
10+
"version": "2.4.30",
1111
"scripts": {
1212
"test": "mocha",
1313
"build": "cake build"

src/Parser.coffee

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,7 @@ class Parser
613613

614614

615615
parseBlockTable: (block, key, line, state, lines) ->
616-
if !!(matches = line.match /^((?:(?:(?:\||\+)(?:[ :]*\-+[ :]*)(?:\||\+))|(?:(?:[ :]*\-+[ :]*)(?:\||\+)(?:[ :]*\-+[ :]*))|(?:(?:[ :]*\-+[ :]*)(?:\||\+))|(?:(?:\||\+)(?:[ :]*\-+[ :]*)))+)$/)
616+
if !!(matches = line.match /^\s*(\|?[ :]*-+[ :]*(?:\|[ :]*-+[ :]*)*\|?)\s*$/)
617617
if @isBlock 'table'
618618
block[3][0].push block[3][2]
619619
block[3][2] += 1

0 commit comments

Comments
 (0)