fix(sfc): treat custom block content as raw text

This commit is contained in:
Evan You
2019-12-22 21:09:39 -05:00
parent 90ddb7c260
commit d6275a3c31
4 changed files with 25 additions and 5 deletions

View File

@@ -10,7 +10,11 @@ export interface ParserOptions {
isCustomElement?: (tag: string) => boolean
isBuiltInComponent?: (tag: string) => symbol | void
getNamespace?: (tag: string, parent: ElementNode | undefined) => Namespace
getTextMode?: (tag: string, ns: Namespace) => TextModes
getTextMode?: (
tag: string,
ns: Namespace,
parent: ElementNode | undefined
) => TextModes
delimiters?: [string, string] // ['{{', '}}']
// Map to HTML entities. E.g., `{ "amp;": "&" }`

View File

@@ -365,7 +365,7 @@ function parseElement(
// Children.
ancestors.push(element)
const mode = context.options.getTextMode(element.tag, element.ns)
const mode = context.options.getTextMode(element.tag, element.ns, parent)
const children = parseChildren(context, mode, ancestors)
ancestors.pop()