@principal-ade/industry-themed-mdx-editor 0.1.5 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.mjs +8 -5
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -9,8 +9,8 @@ var defaultPreprocessRules = [
|
|
|
9
9
|
{
|
|
10
10
|
name: "normalize-code-block-language",
|
|
11
11
|
description: "Normalize unknown or missing code block language identifiers",
|
|
12
|
-
pattern:
|
|
13
|
-
replacement: (_match, lang) => {
|
|
12
|
+
pattern: /^(\s*)```([^\n`]*?)\n/gim,
|
|
13
|
+
replacement: (_match, indent, lang) => {
|
|
14
14
|
const trimmedLang = lang.trim();
|
|
15
15
|
const knownLanguages = [
|
|
16
16
|
"javascript",
|
|
@@ -61,14 +61,17 @@ var defaultPreprocessRules = [
|
|
|
61
61
|
return _match;
|
|
62
62
|
}
|
|
63
63
|
if (!trimmedLang || trimmedLang === "") {
|
|
64
|
-
return
|
|
64
|
+
return `${indent}\`\`\`text
|
|
65
|
+
`;
|
|
65
66
|
}
|
|
66
67
|
const langLower = trimmedLang.toLowerCase();
|
|
67
68
|
if (langLower === "n/a") {
|
|
68
|
-
return
|
|
69
|
+
return `${indent}\`\`\`text
|
|
70
|
+
`;
|
|
69
71
|
}
|
|
70
72
|
if (langLower === "argdown") {
|
|
71
|
-
return
|
|
73
|
+
return `${indent}\`\`\`markdown
|
|
74
|
+
`;
|
|
72
75
|
}
|
|
73
76
|
return _match;
|
|
74
77
|
}
|