Skip to content

Commit 2dcbee3

Browse files
committed
fix: whitespace-sensitivity
1 parent c0a6612 commit 2dcbee3

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"tools"
1313
],
1414
"license": "ISC",
15-
"version": "1.1.2",
15+
"version": "1.1.3",
1616
"engines": {
1717
"vscode": "^1.52.0"
1818
},

src/lib/ast.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,9 @@ export const templateToAst = (code: string) =>
4444
template.ast(code, getParserOptions());
4545

4646
export const isJSX = (code: string) => {
47-
const firstChar = code.trim()[0];
48-
const lastChar = code.trim()[code.length - 1];
47+
const trimmed = code.trim();
48+
const firstChar = trimmed[0];
49+
const lastChar = trimmed[trimmed.length - 1];
4950
if (firstChar !== "<" || lastChar !== ">") return false;
5051

5152
const ast = jsxToAst(code);

0 commit comments

Comments
 (0)