File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -2271,6 +2271,11 @@ describe('compiler: parse', () => {
22712271 expect ( span . loc . start . offset ) . toBe ( 0 )
22722272 expect ( span . loc . end . offset ) . toBe ( 27 )
22732273 } )
2274+
2275+ test ( 'correct loc when a line in attribute value ends with &' , ( ) => {
2276+ const [ span ] = baseParse ( `<span v-if="foo &&\nbar"></span>` ) . children
2277+ expect ( span . loc . end . line ) . toBe ( 2 )
2278+ } )
22742279 } )
22752280
22762281 describe ( 'decodeEntities option' , ( ) => {
Original file line number Diff line number Diff line change @@ -929,7 +929,7 @@ export default class Tokenizer {
929929 this . buffer = input
930930 while ( this . index < this . buffer . length ) {
931931 const c = this . buffer . charCodeAt ( this . index )
932- if ( c === CharCodes . NewLine ) {
932+ if ( c === CharCodes . NewLine && this . state !== State . InEntity ) {
933933 this . newlines . push ( this . index )
934934 }
935935 switch ( this . state ) {
You can’t perform that action at this time.
0 commit comments