refactor(ssr): move escapeHtml to shared

This commit is contained in:
Evan You
2020-02-02 22:08:20 -05:00
parent 327670a034
commit d1eed36452
10 changed files with 37 additions and 24 deletions

View File

@@ -10,7 +10,7 @@ import {
ElementTypes,
createBlockStatement
} from '@vue/compiler-dom'
import { isString } from '@vue/shared'
import { isString, escapeHtml } from '@vue/shared'
// Because SSR codegen output is completely different from client-side output
// (e.g. multiple elements can be concatenated into a single template literal
@@ -85,7 +85,7 @@ function processChildren(
// TODO
}
} else if (child.type === NodeTypes.TEXT) {
// TODO
context.pushStringPart(escapeHtml(child.content))
} else if (child.type === NodeTypes.IF) {
// TODO
} else if (child.type === NodeTypes.FOR) {

View File

@@ -5,7 +5,7 @@ import {
TemplateLiteral,
createTemplateLiteral
} from '@vue/compiler-dom'
import { escapeHtml } from '@vue/server-renderer'
import { escapeHtml } from '@vue/shared'
/*
## Simple Element