We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2116678 commit fa036b0Copy full SHA for fa036b0
docs/mdsx.config.js
@@ -199,11 +199,18 @@ export function rehypeComponentExample() {
199
};
200
}
201
202
+function transformComponentSourceContent(src = "") {
203
+ return src.replaceAll(`import { cn } from "$lib/utils/styles.js"`, `import cn from "clsx"`);
204
+}
205
+
206
function getComponentSourceFileContent(src = "") {
207
if (!src) return null;
208
209
// Read the source file.
210
const filePath = path.join(process.cwd(), `./src/lib/components/demos/${src}.svelte`);
211
- return prettier.format(readFileSync(filePath, "utf-8"), codeBlockPrettierConfig);
212
+ return prettier.format(
213
+ transformComponentSourceContent(readFileSync(filePath, "utf-8")),
214
+ codeBlockPrettierConfig
215
+ );
216
0 commit comments