Skip to content

Commit 082fc39

Browse files
committed
fix(parser): only ignore the first newline in <pre>
fix #6146
1 parent 1713061 commit 082fc39

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Diff for: src/compiler/parser/html-parser.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,6 @@ export function parseHTML (html, options) {
7979
last = html
8080
// Make sure we're not in a plaintext content element like script/style
8181
if (!lastTag || !isPlainTextElement(lastTag)) {
82-
if (shouldIgnoreFirstNewline(lastTag, html)) {
83-
advance(1)
84-
}
8582
let textEnd = html.indexOf('<')
8683
if (textEnd === 0) {
8784
// Comment:
@@ -127,6 +124,9 @@ export function parseHTML (html, options) {
127124
const startTagMatch = parseStartTag()
128125
if (startTagMatch) {
129126
handleStartTag(startTagMatch)
127+
if (shouldIgnoreFirstNewline(lastTag, html)) {
128+
advance(1)
129+
}
130130
continue
131131
}
132132
}

0 commit comments

Comments
 (0)