prettier-plugin-bootstrap 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +8 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -327,8 +327,14 @@ function processHtmlAst(ast, targetAttrs) {
327
327
  if (node.attributes && Array.isArray(node.attributes)) for (const attr of node.attributes) {
328
328
  const name = attr.name || attr.key && attr.key.value;
329
329
  if (targetAttrs.includes(name) && attr.value) {
330
- if (typeof attr.value === "string") attr.value = sortClassString(attr.value);
331
- else if (attr.value && typeof attr.value.value === "string") attr.value.value = sortClassString(attr.value.value);
330
+ if (typeof attr.value === "string") {
331
+ if (attr.kind && attr.kind !== "quoted") continue;
332
+ if (attr.value.includes("${")) continue;
333
+ attr.value = sortClassString(attr.value);
334
+ } else if (attr.value && typeof attr.value.value === "string") {
335
+ if (attr.value.value.includes("${")) continue;
336
+ attr.value.value = sortClassString(attr.value.value);
337
+ }
332
338
  }
333
339
  }
334
340
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "prettier-plugin-bootstrap",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "A Prettier plugin for automatic Bootstrap class sorting",
5
5
  "license": "MIT",
6
6
  "type": "module",