Skip to content

Commit 98c3c54

Browse files
authored
(fix) more robust check for block start (#1641)
#1638
1 parent 37599b9 commit 98c3c54

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/svelte2tsx/src/htmlxtojsx_v2/nodes/IfElseBlock.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { withTrailingPropertyAccess } from '../utils/node-utils';
88
export function handleIf(str: MagicString, ifBlock: Node): void {
99
if (ifBlock.elseif) {
1010
// {:else if expr} --> } else if(expr) {
11-
const start = str.original.lastIndexOf('{:', ifBlock.expression.start);
11+
const start = str.original.lastIndexOf('{', ifBlock.expression.start);
1212
str.overwrite(start, ifBlock.expression.start, '} else if (');
1313
} else {
1414
// {#if expr} --> if (expr){

0 commit comments

Comments
 (0)