Skip to content

Commit 5d494bf

Browse files
committed
chore(docs): Try to allow custom Code/CodeBlock in sandboxes
1 parent 4c492b3 commit 5d494bf

File tree

2 files changed

+2
-13
lines changed

2 files changed

+2
-13
lines changed

packages/dev-utils/src/sandbox/createSandbox.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,6 @@ function transformFileContents(
5050
}
5151

5252
let transformed = contents
53-
.replace(/^import Code(Block)?.+;$/gm, "")
54-
.replace(/<CodeBlock[^>]*>/g, "<pre><code>")
55-
.replace(/<\/CodeBlock>/g, "</code></pre>")
56-
.replace(/<(\/)?Code/g, "<$1code")
5753
.replace(/\.(\.\/TextFieldThemeConfig)/, "$1")
5854
.replace(aliasRegExp, `"${aliasReplacement}`);
5955

packages/dev-utils/src/sandbox/getAllDependencies.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,10 @@ import { getSourceFile } from "./getSourceFile";
1111
export type ReferencedDependencies = Set<string>;
1212
export type ReferencedFiles = Map<string, string>;
1313

14-
// since I don't want to include markdown stuff
15-
const IGNORED_MODULES = ["marked", "prismjs"];
16-
const IGNORED_FILE_REGEXP =
17-
/Markdown|Code|constants\/(github|packages)|@react-md/;
14+
const IGNORED_FILE_REGEXP = /constants\/(github|packages)|@react-md/;
1815

1916
function isIgnoredDependency(name: string): boolean {
20-
return (
21-
IGNORED_MODULES.includes(name) ||
22-
IGNORED_FILE_REGEXP.test(name) ||
23-
/dist\/scssVariables/.test(name)
24-
);
17+
return IGNORED_FILE_REGEXP.test(name) || /dist\/scssVariables/.test(name);
2518
}
2619

2720
const SCSS_IMPORT = /@import '(.+)';/g;

0 commit comments

Comments
 (0)