Merge pull request #1748 from UziTech/indented-tables
fix indented tables to follow gfm spec
This commit is contained in:
commit
1d6afc1774
@ -94,10 +94,10 @@ block.normal = merge({}, block);
|
|||||||
|
|
||||||
block.gfm = merge({}, block.normal, {
|
block.gfm = merge({}, block.normal, {
|
||||||
nptable: '^ *([^|\\n ].*\\|.*)\\n' // Header
|
nptable: '^ *([^|\\n ].*\\|.*)\\n' // Header
|
||||||
+ ' *([-:]+ *\\|[-| :]*)' // Align
|
+ ' {0,3}([-:]+ *\\|[-| :]*)' // Align
|
||||||
+ '(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)', // Cells
|
+ '(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)', // Cells
|
||||||
table: '^ *\\|(.+)\\n' // Header
|
table: '^ *\\|(.+)\\n' // Header
|
||||||
+ ' *\\|?( *[-:]+[-| :]*)' // Align
|
+ ' {0,3}\\|?( *[-:]+[-| :]*)' // Align
|
||||||
+ '(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)' // Cells
|
+ '(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)' // Cells
|
||||||
});
|
});
|
||||||
|
|
||||||
|
6
test/specs/new/indented_tables.html
Normal file
6
test/specs/new/indented_tables.html
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<p>
|
||||||
|
| abc | def |
|
||||||
|
| --- | --- |
|
||||||
|
| bar | foo |
|
||||||
|
| baz | boo |
|
||||||
|
</p>
|
4
test/specs/new/indented_tables.md
Normal file
4
test/specs/new/indented_tables.md
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
| abc | def |
|
||||||
|
| --- | --- |
|
||||||
|
| bar | foo |
|
||||||
|
| baz | boo |
|
Loading…
x
Reference in New Issue
Block a user