File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed
bundler-webpack/src/build Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -75,7 +75,11 @@ export const renderPage = async ({
7575 '<!--vuepress-ssr-styles-->' ,
7676 renderPageStyles ( { app, outputCssAsset } )
7777 )
78- . replace ( '<!--vuepress-ssr-app-->' , pageRendered )
78+ // page content
79+ // notice that some special chars in string like `$&` would be recognized by `replace()`,
80+ // and they won't be html-escaped and will be kept as is when they are inside a code block,
81+ // so we use a replace function as the second param to avoid those potential issues
82+ . replace ( '<!--vuepress-ssr-app-->' , ( ) => pageRendered )
7983 // page scripts
8084 . replace (
8185 '<!--vuepress-ssr-scripts-->' ,
Original file line number Diff line number Diff line change @@ -94,7 +94,11 @@ export const renderPage = async ({
9494 '<!--vuepress-ssr-styles-->' ,
9595 renderPageStyles ( { app, initialFilesMeta, pageClientFilesMeta } )
9696 )
97- . replace ( '<!--vuepress-ssr-app-->' , pageRendered )
97+ // page content
98+ // notice that some special chars in string like `$&` would be recognized by `replace()`,
99+ // and they won't be html-escaped and will be kept as is when they are inside a code block,
100+ // so we use a replace function as the second param to avoid those potential issues
101+ . replace ( '<!--vuepress-ssr-app-->' , ( ) => pageRendered )
98102 // page scripts
99103 . replace (
100104 '<!--vuepress-ssr-scripts-->' ,
You can’t perform that action at this time.
0 commit comments