We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 79aa1ed commit 675bfc4Copy full SHA for 675bfc4
packages/svelte2tsx/src/htmlxtojsx_v2/nodes/Attribute.ts
@@ -171,10 +171,12 @@ export function handleAttribute(
171
return;
172
}
173
174
+ const lastCharIndex = attrVal.end - 1;
175
const hasBrackets =
- str.original.lastIndexOf('}', attrVal.end) === attrVal.end - 1 ||
176
- str.original.lastIndexOf('}"', attrVal.end) === attrVal.end - 1 ||
177
- str.original.lastIndexOf("}'", attrVal.end) === attrVal.end - 1;
+ str.original[lastCharIndex] === '}' ||
+ ((str.original[lastCharIndex] === '"' || str.original[lastCharIndex] === "'") &&
178
+ str.original[lastCharIndex - 1] === '}');
179
+
180
const needsNumberConversion =
181
!hasBrackets &&
182
parent.type === 'Element' &&
0 commit comments