Skip to content

Commit

Permalink
fix(prefixIds): sameline comments (#1942)
Browse files Browse the repository at this point in the history
  • Loading branch information
john-neptune authored Jan 23, 2024
1 parent 7882488 commit 10e5e5e
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 1 deletion.
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,11 @@ coverage
.DS_Store
.vscode
*.log

# https://github.com/github/gitignore/blob/main/Global/Vim.gitignore
[._]*.s[a-v][a-z]
!*.svg # comment out if you don't need vector files
[._]*.sw[a-p]
[._]s[a-rt-v][a-z]
[._]ss[a-gi-z]
[._]sw[a-p]
1 change: 0 additions & 1 deletion plugins/prefixIds.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,6 @@ export const fn = (_root, params, info) => {
});

child.value = csstree.generate(cssAst);
return;
}
}

Expand Down
23 changes: 23 additions & 0 deletions test/plugins/prefixIds.13.svg.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Prefix IDs should apply to all nodes in styles, namely when styles are split
into multiple nodes due to XML comments.

===

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1 1">
<style>
<!-- uwu -->
#a13 {} <!-- xyz -->
#b13 {}
</style>
</svg>

@@@

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1 1">
<style>
<!--uwu-->
#prefixIds_13_svg_txt__a13{}
<!--xyz-->
#prefixIds_13_svg_txt__b13{}
</style>
</svg>

0 comments on commit 10e5e5e

Please sign in to comment.