@@ -322,7 +322,7 @@ export default class Tokenizer {
322
322
}
323
323
this . state = State . BeforeTagName
324
324
this . sectionStart = this . index
325
- } else if ( ! __BROWSER__ && c === CharCodes . Amp ) {
325
+ } else if ( ! __BROWSER__ && c === CharCodes . Amp && ! this . isLogicalAnd ( ) ) {
326
326
this . startEntity ( )
327
327
} else if ( ! this . inVPre && c === this . delimiterOpen [ 0 ] ) {
328
328
this . state = State . InterpolationOpen
@@ -436,7 +436,7 @@ export default class Tokenizer {
436
436
( this . currentSequence === Sequences . TextareaEnd && ! this . inSFCRoot )
437
437
) {
438
438
// We have to parse entities in <title> and <textarea> tags.
439
- if ( ! __BROWSER__ && c === CharCodes . Amp ) {
439
+ if ( ! __BROWSER__ && c === CharCodes . Amp && ! this . isLogicalAnd ( ) ) {
440
440
this . startEntity ( )
441
441
} else if ( ! this . inVPre && c === this . delimiterOpen [ 0 ] ) {
442
442
// We also need to handle interpolation
@@ -795,7 +795,7 @@ export default class Tokenizer {
795
795
this . index + 1 ,
796
796
)
797
797
this . state = State . BeforeAttrName
798
- } else if ( ! __BROWSER__ && c === CharCodes . Amp ) {
798
+ } else if ( ! __BROWSER__ && c === CharCodes . Amp && ! this . isLogicalAnd ( ) ) {
799
799
this . startEntity ( )
800
800
}
801
801
}
@@ -823,7 +823,7 @@ export default class Tokenizer {
823
823
ErrorCodes . UNEXPECTED_CHARACTER_IN_UNQUOTED_ATTRIBUTE_VALUE ,
824
824
this . index ,
825
825
)
826
- } else if ( ! __BROWSER__ && c === CharCodes . Amp ) {
826
+ } else if ( ! __BROWSER__ && c === CharCodes . Amp && ! this . isLogicalAnd ( ) ) {
827
827
this . startEntity ( )
828
828
}
829
829
}
@@ -1178,4 +1178,11 @@ export default class Tokenizer {
1178
1178
}
1179
1179
}
1180
1180
}
1181
+
1182
+ private isLogicalAnd ( ) : boolean {
1183
+ return (
1184
+ this . buffer . charCodeAt ( this . index - 1 ) === CharCodes . Amp ||
1185
+ this . buffer . charCodeAt ( this . index + 1 ) === CharCodes . Amp
1186
+ )
1187
+ }
1181
1188
}
0 commit comments