mirror of
https://github.com/zoriya/yoshiki.git
synced 2025-12-06 07:06:13 +00:00
Fix css name sanitization
This commit is contained in:
@@ -79,6 +79,7 @@ function App() {
|
||||
backgroundColor: "#fff",
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
elevation: 6,
|
||||
})}
|
||||
>
|
||||
<Text>Open up App.tsx to start working on your app!</Text>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "yoshiki",
|
||||
"version": "0.3.3",
|
||||
"version": "0.3.4",
|
||||
"author": "Zoe Roux <zoe.roux@sdg.moe> (https://github.com/AnonymusRaccoon)",
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
|
||||
@@ -43,7 +43,7 @@ const stateMapper: {
|
||||
const sanitize = (className: unknown) => {
|
||||
const name = typeof className === "string" ? className : JSON.stringify(className);
|
||||
if (name === undefined) return "undefined";
|
||||
return name.replaceAll(/[^\w-_]/g, "");
|
||||
return name.replaceAll(/[^\w\d_]/g, "");
|
||||
};
|
||||
|
||||
type PreprocessBlockFunction = (block: { [key: string]: unknown }) => { [key: string]: unknown };
|
||||
@@ -67,6 +67,7 @@ const generateClass = (
|
||||
: [`${cssKey}: ${nValue};`];
|
||||
})
|
||||
.join(" ");
|
||||
if (!block.length) return [];
|
||||
return [[className, addCssContext(className, `{ ${block} }`)]];
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user