fix indented tables to act like gfm

This commit is contained in:
Tony Brix 2020-08-12 16:21:46 -05:00
parent 902a9273e1
commit 2e99532bbd
3 changed files with 12 additions and 2 deletions

View File

@ -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
});

View File

@ -0,0 +1,6 @@
<p>
| abc | def |
| --- | --- |
| bar | foo |
| baz | boo |
</p>

View File

@ -0,0 +1,4 @@
| abc | def |
| --- | --- |
| bar | foo |
| baz | boo |