Skip to content

Commit 20b63a4

Browse files
committed
Prioritize dynamic attribute check over static
1 parent 52ba0ad commit 20b63a4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -279,9 +279,7 @@ function transformHtml(ast: any, { env, changes }: TransformerContext) {
279279
let { parser } = env.options
280280

281281
for (let attr of ast.attrs ?? []) {
282-
if (isSortableAttribute(attr.name, env.customizations)) {
283-
attr.value = sortClasses(attr.value, { env })
284-
} else if (dynamicAttrs.has(attr.name)) {
282+
if (dynamicAttrs.has(attr.name)) {
285283
if (!/[`'"]/.test(attr.value)) {
286284
continue
287285
}
@@ -291,6 +289,8 @@ function transformHtml(ast: any, { env, changes }: TransformerContext) {
291289
} else {
292290
transformDynamicJsAttribute(attr, env)
293291
}
292+
} else if (isSortableAttribute(attr.name, env.customizations)) {
293+
attr.value = sortClasses(attr.value, { env })
294294
}
295295
}
296296

0 commit comments

Comments
 (0)