Merge pull request #1748 from UziTech/indented-tables

fix indented tables to follow gfm spec
This commit is contained in:
Steven 2020-08-13 10:33:43 -04:00 committed by GitHub
commit 1d6afc1774
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 2 deletions

View File

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

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 |