@@ -101,7 +101,7 @@ export const other = {
101101 headingBeginRegex : cachedIndentRegex ( ( indent : number ) => new RegExp ( `^ {0,${ indent } }#` ) ) ,
102102 // a list item ends where a paragraph would be interrupted, so this mirrors the
103103 // html start conditions in the paragraph rule below; type 7 is excluded there
104- htmlBeginRegex : cachedIndentRegex ( ( indent : number ) => new RegExp ( `^ {0,${ indent } }(?:</?(?:${ _tag } )(?: +|$|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--))` , 'i' ) ) ,
104+ htmlBeginRegex : cachedIndentRegex ( ( indent : number ) => new RegExp ( `^ {0,${ indent } }(?:</?(?:${ _tag } )(?: +|$|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[ )` , 'i' ) ) ,
105105 blockquoteBeginRegex : cachedIndentRegex ( ( indent : number ) => new RegExp ( `^ {0,${ indent } }>` ) ) ,
106106} ;
107107
@@ -179,8 +179,8 @@ const createParagraph = (listInterrupt: RegExp) => edit(_paragraph)
179179 . replace ( 'blockquote' , ' {0,3}>' )
180180 . replace ( 'fences' , ' {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)' )
181181 . replace ( 'list' , listInterrupt )
182- . replace ( 'html' , '</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)' )
183- . replace ( 'tag' , _tag ) // pars can be interrupted by type (6) html blocks
182+ . replace ( 'html' , ' {0,3}(?: </?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[ )' )
183+ . replace ( 'tag' , _tag ) // pars can be interrupted by html blocks of types (1) to (6)
184184 . getRegex ( ) ;
185185
186186// only non-empty lists starting from 1 can interrupt paragraphs
@@ -230,8 +230,8 @@ const gfmTable = edit(
230230 . replace ( 'code' , '(?: {4}| {0,3}\t)[^\\n]' )
231231 . replace ( 'fences' , ' {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)' )
232232 . replace ( 'list' , ' {0,3}(?:[*+-]|1[.)])[ \\t]' ) // any bullet ends the table rows
233- . replace ( 'html' , '</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)' )
234- . replace ( 'tag' , _tag ) // tables can be interrupted by type (6) html blocks
233+ . replace ( 'html' , ' {0,3}(?: </?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[ )' )
234+ . replace ( 'tag' , _tag ) // tables can be interrupted by html blocks of types (1) to (6)
235235 . getRegex ( ) ;
236236
237237const blockGfm : Record < BlockKeys , RegExp > = {
@@ -246,8 +246,8 @@ const blockGfm: Record<BlockKeys, RegExp> = {
246246 . replace ( 'blockquote' , ' {0,3}>' )
247247 . replace ( 'fences' , ' {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)' )
248248 . replace ( 'list' , ' {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]' ) // only non-empty lists starting from 1 can interrupt
249- . replace ( 'html' , '</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)' )
250- . replace ( 'tag' , _tag ) // pars can be interrupted by type (6) html blocks
249+ . replace ( 'html' , ' {0,3}(?: </?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[ )' )
250+ . replace ( 'tag' , _tag ) // pars can be interrupted by html blocks of types (1) to (6)
251251 . getRegex ( ) ,
252252} ;
253253
0 commit comments