@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.
Files changed (2) hide show
  1. package/dist/index.mjs +8 -5
  2. 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: /^```([^\n`]*?)\n/gim,
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 "```text\n";
64
+ return `${indent}\`\`\`text
65
+ `;
65
66
  }
66
67
  const langLower = trimmedLang.toLowerCase();
67
68
  if (langLower === "n/a") {
68
- return "```text\n";
69
+ return `${indent}\`\`\`text
70
+ `;
69
71
  }
70
72
  if (langLower === "argdown") {
71
- return "```markdown\n";
73
+ return `${indent}\`\`\`markdown
74
+ `;
72
75
  }
73
76
  return _match;
74
77
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@principal-ade/industry-themed-mdx-editor",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "description": "Industry-themed MDX editor wrapper with integrated theming",
5
5
  "type": "module",
6
6
  "main": "dist/index.mjs",