expect(span.loc.start.offset).toBe(0)
expect(span.loc.end.offset).toBe(27)
})
+
+ test('correct loc when a line in attribute value ends with &', () => {
+ const [span] = baseParse(`<span v-if="foo &&\nbar"></span>`).children
+ expect(span.loc.end.line).toBe(2)
+ })
})
describe('decodeEntities option', () => {
this.buffer = input
while (this.index < this.buffer.length) {
const c = this.buffer.charCodeAt(this.index)
- if (c === CharCodes.NewLine) {
+ if (c === CharCodes.NewLine && this.state !== State.InEntity) {
this.newlines.push(this.index)
}
switch (this.state) {