Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/compiler/parser/html-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export function parseHTML (html, options) {
}

let text, rest, next
if (textEnd > 0) {
if (textEnd >= 0) {
rest = html.slice(textEnd)
while (
!endTag.test(rest) &&
Expand Down
9 changes: 9 additions & 0 deletions test/unit/modules/sfc/sfc-parser.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,15 @@ describe('Single File Component parser', () => {
expect(res.template.content.trim()).toBe(`div\n h1(v-if='1 < 2') hello`)
})

it('should handle component contains "<" only', () => {
const res = parseComponent(`
<template>
<span><</span>
</template>
`)
expect(res.template.content.trim()).toBe(`<span><</span>`)
})

it('should handle custom blocks without parsing them', () => {
const res = parseComponent(`
<template>
Expand Down