Skip to content

Commit

Permalink
fix: parseText
Browse files Browse the repository at this point in the history
  • Loading branch information
cuixiaorui committed Feb 19, 2022
1 parent 4470fc4 commit eee97a1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/compiler-core/src/parse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,11 @@ function parseText(context): any {

for (let i = 0; i < endTokens.length; i++) {
const index = context.source.indexOf(endTokens[i]);
if (index !== -1) {
// endIndex > index 是需要要 endIndex 尽可能的小
// 比如说:
// hi, {{123}} <div></div>
// 那么这里就应该停到 {{ 这里,而不是停到 <div 这里
if (index !== -1 && endIndex > index) {
endIndex = index;
}
}
Expand Down

0 comments on commit eee97a1

Please sign in to comment.