Skip to content

Commit 2eea457

Browse files
committed
fix
1 parent 8b30a8a commit 2eea457

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/parser/converts/attr.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,9 @@ function convertAttribute(
190190
});
191191
return sAttr;
192192
}
193+
// Not required for shorthands. Therefore, register the token here.
194+
ctx.addToken("HTMLIdentifier", keyRange);
195+
193196
processAttributeValue(
194197
node.value as (
195198
| SvAST.Text
@@ -202,9 +205,6 @@ function convertAttribute(
202205
ctx,
203206
);
204207

205-
// Not required for shorthands. Therefore, register the token here.
206-
ctx.addToken("HTMLIdentifier", keyRange);
207-
208208
return attribute;
209209
}
210210

src/parser/converts/root.ts

+2
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import {
2626
getModuleFromRoot,
2727
getOptionsFromRoot,
2828
} from "../compat";
29+
import { sortNodes } from "../sort";
2930

3031
/**
3132
* Convert root
@@ -260,6 +261,7 @@ function convertGenericsAttribute(script: SvelteScriptElement, ctx: Context) {
260261
delete (genericsAttribute as any).value;
261262

262263
// Remove value token indexes
264+
sortNodes(ctx.tokens);
263265
const firstTokenIndex = ctx.tokens.findIndex(
264266
(token) =>
265267
value.range[0] <= token.range[0] && token.range[1] <= value.range[1],

0 commit comments

Comments
 (0)