Skip to content

Commit

Permalink
fix(parser): only ignore the first newline in <pre>
Browse files Browse the repository at this point in the history
fix #6146
  • Loading branch information
yyx990803 committed Jul 20, 2017
1 parent 1713061 commit 082fc39
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/compiler/parser/html-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,6 @@ export function parseHTML (html, options) {
last = html
// Make sure we're not in a plaintext content element like script/style
if (!lastTag || !isPlainTextElement(lastTag)) {
if (shouldIgnoreFirstNewline(lastTag, html)) {
advance(1)
}
let textEnd = html.indexOf('<')
if (textEnd === 0) {
// Comment:
Expand Down Expand Up @@ -127,6 +124,9 @@ export function parseHTML (html, options) {
const startTagMatch = parseStartTag()
if (startTagMatch) {
handleStartTag(startTagMatch)
if (shouldIgnoreFirstNewline(lastTag, html)) {
advance(1)
}
continue
}
}
Expand Down

0 comments on commit 082fc39

Please sign in to comment.