diff --git a/changelog_unreleased/html/10906.md b/changelog_unreleased/html/10906.md new file mode 100644 index 000000000..54d664af9 --- /dev/null +++ b/changelog_unreleased/html/10906.md @@ -0,0 +1,29 @@ +#### Allow `:` as class prefix delimiter (#10906 by @tkalmar) + + +```html + +
+ + + + + + +``` diff --git a/src/language-html/syntax-attribute.js b/src/language-html/syntax-attribute.js index cb655da24..c7caa0a8a 100644 --- a/src/language-html/syntax-attribute.js +++ b/src/language-html/syntax-attribute.js @@ -60,7 +60,7 @@ function printImgSrcset(value) { ); } -const prefixDelimiters = ["__", "--", "_", "-"]; +const prefixDelimiters = [":", "__", "--", "_", "-"]; function getClassPrefix(className) { const startIndex = className.search(/[^_-]/); diff --git a/tests/format/html/attributes/__snapshots__/jsfmt.spec.js.snap b/tests/format/html/attributes/__snapshots__/jsfmt.spec.js.snap index 9dc2e0790..dbfbc7b90 100644 --- a/tests/format/html/attributes/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/html/attributes/__snapshots__/jsfmt.spec.js.snap @@ -341,6 +341,27 @@ printWidth: 80 ================================================================================ `; +exports[`class-colon.html format 1`] = ` +====================================options===================================== +parsers: ["html"] +printWidth: 80 + | printWidth +=====================================input====================================== +