mirror of https://github.com/vuejs/core.git
wip: pre tag handling
This commit is contained in:
parent
5762288bdf
commit
1a1f680536
|
|
@ -274,10 +274,13 @@ function emitOpenTag(name: string, start: number) {
|
||||||
function endOpenTag(end: number) {
|
function endOpenTag(end: number) {
|
||||||
addNode(currentElement!)
|
addNode(currentElement!)
|
||||||
const name = currentElement!.tag
|
const name = currentElement!.tag
|
||||||
if (!currentOptions.isVoidTag(name)) {
|
if (currentOptions.isPreTag(name)) {
|
||||||
stack.unshift(currentElement!)
|
inPre++
|
||||||
} else {
|
}
|
||||||
|
if (currentOptions.isVoidTag(name)) {
|
||||||
onCloseTag(currentElement!, end)
|
onCloseTag(currentElement!, end)
|
||||||
|
} else {
|
||||||
|
stack.unshift(currentElement!)
|
||||||
}
|
}
|
||||||
currentElement = null
|
currentElement = null
|
||||||
}
|
}
|
||||||
|
|
@ -319,6 +322,9 @@ function onCloseTag(el: ElementNode, end: number) {
|
||||||
el.loc.end = tokenizer.getPos(end + offset + 1)
|
el.loc.end = tokenizer.getPos(end + offset + 1)
|
||||||
// whitepsace management
|
// whitepsace management
|
||||||
el.children = condenseWhitespace(el.children)
|
el.children = condenseWhitespace(el.children)
|
||||||
|
if (currentOptions.isPreTag(el.tag)) {
|
||||||
|
inPre--
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const windowsNewlineRE = /\r\n/g
|
const windowsNewlineRE = /\r\n/g
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue