Skip to content

Commit a153fdf

Browse files
author
DESKTOP-939248N\apple
committed
fix: parsing classNames
1 parent 403db83 commit a153fdf

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

docs/test.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ <h1 class="color:white:dark color:yellow:light">hello how are you</h1>
5959
<a data-toggle="dark, light" data-toggle_target="[theme]" data-toggle_attribute="theme">Toggle Darkmode</a>
6060
</div>
6161

62-
<div class="display:flex flex-wrap:wrap align-items:center flex-direction:row-reverse" className="test"></div>
62+
<div class="display:flex flex-wrap:wrap align-items:center flex-direction:row-reverse" className="test">hehehe</div>
6363
<div class="test"></div>
6464
<div class="test"></div>
6565

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ const getParsedCss = () => {
107107
const parseCSSForClassNames = () => {
108108
let elements = document.querySelectorAll("[className]");
109109
for (let ele of elements) {
110-
let rule = "." + ele.getAttribute("className") + "{" + ele.getAttribute("class") + "}";
110+
let rule = "." + ele.getAttribute("className") + "{" + ele.getAttribute("class").replace(/ /g, ";") + "}";
111111
tempStyleList.push(rule);
112112
}
113113
}

0 commit comments

Comments
 (0)