Skip to content

Commit eb9252b

Browse files
committed
fix(ssr): renderToString cannot render comment
1 parent 7075408 commit eb9252b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Diff for: src/server/optimizing-compiler/codegen.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,11 @@ function nodesToSegments (
225225
} else if (c.type === 2) {
226226
segments.push({ type: INTERPOLATION, value: c.expression })
227227
} else if (c.type === 3) {
228-
segments.push({ type: RAW, value: escape(c.text) })
228+
let text = escape(c.text)
229+
if (c.isComment) {
230+
text = '<!--' + text + '-->'
231+
}
232+
segments.push({ type: RAW, value: text })
229233
}
230234
}
231235
return segments

0 commit comments

Comments
 (0)