Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ota-meshi committed Mar 3, 2024
1 parent 8b30a8a commit 2eea457
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/parser/converts/attr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,9 @@ function convertAttribute(
});
return sAttr;
}
// Not required for shorthands. Therefore, register the token here.
ctx.addToken("HTMLIdentifier", keyRange);

processAttributeValue(
node.value as (
| SvAST.Text
Expand All @@ -202,9 +205,6 @@ function convertAttribute(
ctx,
);

// Not required for shorthands. Therefore, register the token here.
ctx.addToken("HTMLIdentifier", keyRange);

return attribute;
}

Expand Down
2 changes: 2 additions & 0 deletions src/parser/converts/root.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import {
getModuleFromRoot,
getOptionsFromRoot,
} from "../compat";
import { sortNodes } from "../sort";

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

// Remove value token indexes
sortNodes(ctx.tokens);
const firstTokenIndex = ctx.tokens.findIndex(
(token) =>
value.range[0] <= token.range[0] && token.range[1] <= value.range[1],
Expand Down

0 comments on commit 2eea457

Please sign in to comment.