Skip to content

Commit

Permalink
(fix) more robust check for block start (#1641)
Browse files Browse the repository at this point in the history
  • Loading branch information
dummdidumm committed Sep 16, 2022
1 parent 37599b9 commit 98c3c54
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/svelte2tsx/src/htmlxtojsx_v2/nodes/IfElseBlock.ts
Expand Up @@ -8,7 +8,7 @@ import { withTrailingPropertyAccess } from '../utils/node-utils';
export function handleIf(str: MagicString, ifBlock: Node): void {
if (ifBlock.elseif) {
// {:else if expr} --> } else if(expr) {
const start = str.original.lastIndexOf('{:', ifBlock.expression.start);
const start = str.original.lastIndexOf('{', ifBlock.expression.start);
str.overwrite(start, ifBlock.expression.start, '} else if (');
} else {
// {#if expr} --> if (expr){
Expand Down

0 comments on commit 98c3c54

Please sign in to comment.