diff --git a/src/rules.js b/src/rules.js index fd8000e2..f6ef4529 100644 --- a/src/rules.js +++ b/src/rules.js @@ -94,10 +94,10 @@ block.normal = merge({}, block); block.gfm = merge({}, block.normal, { nptable: '^ *([^|\\n ].*\\|.*)\\n' // Header - + ' *([-:]+ *\\|[-| :]*)' // Align + + ' {0,3}([-:]+ *\\|[-| :]*)' // Align + '(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)', // Cells table: '^ *\\|(.+)\\n' // Header - + ' *\\|?( *[-:]+[-| :]*)' // Align + + ' {0,3}\\|?( *[-:]+[-| :]*)' // Align + '(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)' // Cells }); diff --git a/test/specs/new/indented_tables.html b/test/specs/new/indented_tables.html new file mode 100644 index 00000000..a08f3aaf --- /dev/null +++ b/test/specs/new/indented_tables.html @@ -0,0 +1,6 @@ +

+| abc | def | +| --- | --- | +| bar | foo | +| baz | boo | +

diff --git a/test/specs/new/indented_tables.md b/test/specs/new/indented_tables.md new file mode 100644 index 00000000..9bd784c2 --- /dev/null +++ b/test/specs/new/indented_tables.md @@ -0,0 +1,4 @@ +| abc | def | + | --- | --- | + | bar | foo | + | baz | boo |