This repository was archived by the owner on Apr 22, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +22
-3
lines changed
Expand file tree Collapse file tree 2 files changed +22
-3
lines changed Original file line number Diff line number Diff line change @@ -245,7 +245,7 @@ function PR_attribToHtml(str) {
245245 return str . replace ( / & / g, '&' )
246246 . replace ( / < / g, '<' )
247247 . replace ( / > / g, '>' )
248- . replace ( / " / g, '"' )
248+ . replace ( / \ "/ g, '"' )
249249 . replace ( / \xa0 / , ' ' ) ;
250250}
251251
@@ -730,7 +730,20 @@ function PR_splitStringAndCommentTokens(chunks) {
730730 }
731731 k += s . length ;
732732 }
733- tokenEnds . push ( new PR_TokenEnd ( k , PR_PLAIN ) ) ; // a token ends at the end
733+ var endTokenType ;
734+ switch ( state ) {
735+ case 1 : case 2 :
736+ endTokenType = PR_STRING ;
737+ break ;
738+ case 4 : case 5 : case 6 :
739+ endTokenType = PR_COMMENT ;
740+ break ;
741+ default :
742+ endTokenType = PR_PLAIN ;
743+ break ;
744+ }
745+ // handle unclosed token which can legally happen for line comments (state 4)
746+ tokenEnds . push ( new PR_TokenEnd ( k , endTokenType ) ) ; // a token ends at the end
734747
735748 return PR_splitChunks ( chunks , tokenEnds ) ;
736749}
Original file line number Diff line number Diff line change @@ -293,6 +293,10 @@ <h1>HTML using XMP</h1>
293293< h1 > Whitespace</ h1 >
294294< pre class =prettyprint id ="whitespace "> </ pre >
295295
296+ < h1 > Misc</ h1 >
297+ < pre class =prettyprint id ="misc1 "> // ends with line comment token
298+ //</ pre >
299+
296300</ body >
297301
298302< script type ="text/javascript ">
@@ -662,7 +666,9 @@ <h1>Whitespace</h1>
662666 ' `END`END`TAG</script>`END`PLN<br>' +
663667 ' `END`TAG</body>`END`PLN<br>' +
664668 '`END`TAG</html>`END' ) ,
665- whitespace : ''
669+ whitespace : '' ,
670+ misc1 : '`COM// ends with line comment token`END`PLN<br>' +
671+ '`END`COM//`END'
666672} ;
667673
668674
You can’t perform that action at this time.
0 commit comments