@@ -93,22 +93,34 @@ block.normal = merge({}, block);
93
93
*/
94
94
95
95
block . gfm = merge ( { } , block . normal , {
96
- nptable : / ^ * ( [ ^ | \n ] .* \| .* ) \n * ( [ - : ] + * \| [ - | : ] * ) (?: \n ( (?: .* [ ^ > \n ] .* (?: \n | $ ) ) * ) \n * | $ ) / ,
96
+ nptable : '^ *([^|\\n ].*\\|.*)\\n' // Header
97
+ + ' *([-:]+ *\\|[-| :]*)' // Align
98
+ + '(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)' , // Cells
97
99
table : '^ *\\|(.+)\\n' // Header
98
100
+ ' *\\|?( *[-:]+[-| :]*)' // Align
99
- + '(?:\\n((?:(?!^|>| \\n| | hr|heading|lheading |code|fences|list|html).*(?:\\n|$))*)\\n*|$)' // Cells
101
+ + '(?:\\n * ((?:(?!\\n|hr|heading|blockquote |code|fences|list|html).*(?:\\n|$))*)\\n*|$)' // Cells
100
102
} ) ;
101
103
104
+ block . gfm . nptable = edit ( block . gfm . nptable )
105
+ . replace ( 'hr' , block . hr )
106
+ . replace ( 'heading' , ' {0,3}#{1,6} ' )
107
+ . replace ( 'blockquote' , ' {0,3}>' )
108
+ . replace ( 'code' , ' {4}[^\\n]' )
109
+ . replace ( 'fences' , ' {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n' )
110
+ . replace ( 'list' , ' {0,3}(?:[*+-]|1[.)]) ' ) // only lists starting from 1 can interrupt
111
+ . replace ( 'html' , '</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)' )
112
+ . replace ( 'tag' , block . _tag ) // tables can be interrupted by type (6) html blocks
113
+ . getRegex ( ) ;
114
+
102
115
block . gfm . table = edit ( block . gfm . table )
103
116
. replace ( 'hr' , block . hr )
104
117
. replace ( 'heading' , ' {0,3}#{1,6} ' )
105
- . replace ( 'lheading' , '([^\\n]+)\\n {0,3}(=+|-+) *(?:\\n+|$)' )
106
118
. replace ( 'blockquote' , ' {0,3}>' )
107
119
. replace ( 'code' , ' {4}[^\\n]' )
108
120
. replace ( 'fences' , ' {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n' )
109
121
. replace ( 'list' , ' {0,3}(?:[*+-]|1[.)]) ' ) // only lists starting from 1 can interrupt
110
122
. replace ( 'html' , '</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)' )
111
- . replace ( 'tag' , block . _tag ) // pars can be interrupted by type (6) html blocks
123
+ . replace ( 'tag' , block . _tag ) // tables can be interrupted by type (6) html blocks
112
124
. getRegex ( ) ;
113
125
114
126
/**
0 commit comments