File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ import { SandboxOptions } from "./sandpack";
66const escapeHTMLComment = ( content : string ) => {
77 // It will be restored when parsing comment
88 // to avoid break -->
9- return content . replaceAll ( "<!--" , "\\u003c\\u0021\\u002d\\u002d" ) . replaceAll ( "-->" , "\\u002d\\u002d\\u003e" ) ;
9+ return content . split ( "<!--" ) . join ( "\\u003c\\u0021\\u002d\\u002d" ) . split ( "-->" ) . join ( "\\u002d\\u002d\\u003e" ) ;
1010} ;
1111export const inlineFiles = ( content : string , filePath : string ) => {
1212 const baseDir = path . dirname ( filePath ) ;
Original file line number Diff line number Diff line change @@ -18,8 +18,10 @@ Actual: ${comment}
1818 try {
1919 const json = JSON . parse (
2020 optionString [ 1 ]
21- . replaceAll ( "\\\\u003c\\\\u0021\\\\u002d\\\\u002d" , "<!--" )
22- . replaceAll ( "\\\\u002d\\\\u002d\\\\u003e" , "-->" )
21+ . split ( "\\\\u003c\\\\u0021\\\\u002d\\\\u002d" )
22+ . join ( "<!--" )
23+ . split ( "\\\\u002d\\\\u002d\\\\u003e" )
24+ . join ( "-->" )
2325 ) ;
2426 return {
2527 ...json
You can’t perform that action at this time.
0 commit comments