@@ -878,7 +878,7 @@ window['_pr_isIE6'] = function () {
878878 }
879879
880880 isEmbedded = style . length >= 5 && 'lang-' === style . substring ( 0 , 5 ) ;
881- if ( isEmbedded && ! ( match && match [ 1 ] ) ) {
881+ if ( isEmbedded && ! ( match && typeof match [ 1 ] === 'string' ) ) {
882882 isEmbedded = false ;
883883 style = PR_SOURCE ;
884884 }
@@ -895,8 +895,14 @@ window['_pr_isIE6'] = function () {
895895 var embeddedSource = match [ 1 ] ;
896896 var embeddedSourceStart = token . indexOf ( embeddedSource ) ;
897897 var embeddedSourceEnd = embeddedSourceStart + embeddedSource . length ;
898+ if ( match [ 2 ] ) {
899+ // If embeddedSource can be blank, then it would match at the
900+ // beginning which would cause us to infinitely recurse on the
901+ // entire token, so we catch the right context in match[2].
902+ embeddedSourceEnd = token . length - match [ 2 ] . length ;
903+ embeddedSourceStart = embeddedSourceEnd - embeddedSource . length ;
904+ }
898905 var lang = style . substring ( 5 ) ;
899- var size = decorations . length - 10 ;
900906 // Decorate the left of the embedded source
901907 appendDecorations (
902908 basePos + tokenStart ,
@@ -1200,9 +1206,9 @@ window['_pr_isIE6'] = function () {
12001206 [ PR_PUNCTUATION , / ^ (?: < [ % ? ] | [ % ? ] > ) / ] ,
12011207 [ 'lang-' , / ^ < x m p \b [ ^ > ] * > ( [ \s \S ] + ?) < \/ x m p \b [ ^ > ] * > / i] ,
12021208 // Unescaped content in javascript. (Or possibly vbscript).
1203- [ 'lang-js' , / ^ < s c r i p t \b [ ^ > ] * > ( [ \s \S ] + ? ) < \/ s c r i p t \b [ ^ > ] * > / i] ,
1209+ [ 'lang-js' , / ^ < s c r i p t \b [ ^ > ] * > ( [ \s \S ] * ? ) ( < \/ s c r i p t \b [ ^ > ] * > ) / i] ,
12041210 // Contains unescaped stylesheet content
1205- [ 'lang-css' , / ^ < s t y l e \b [ ^ > ] * > ( [ \s \S ] + ? ) < \/ s t y l e \b [ ^ > ] * > / i] ,
1211+ [ 'lang-css' , / ^ < s t y l e \b [ ^ > ] * > ( [ \s \S ] * ? ) ( < \/ s t y l e \b [ ^ > ] * > ) / i] ,
12061212 [ 'lang-in.tag' , / ^ ( < \/ ? [ a - z ] [ ^ < > ] * > ) / i]
12071213 ] ) ,
12081214 [ 'default-markup' , 'htm' , 'html' , 'mxml' , 'xhtml' , 'xml' , 'xsl' ] ) ;
0 commit comments