@clidey/dory 0.11.0 → 0.12.0

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@clidey/dory",
3
3
  "private": false,
4
- "version": "0.11.0",
4
+ "version": "0.12.0",
5
5
  "type": "module",
6
6
  "description": "A CLI tool for building and previewing documentation sites",
7
7
  "keywords": [
@@ -40,8 +40,11 @@ export function preprocessMdxTags() {
40
40
  transform(code: string, id: string) {
41
41
  if (!id.endsWith('.mdx')) return;
42
42
 
43
+ // Remove leading whitespace from code fence blocks
44
+ let processed = code.replace(/^(\s+)(```\w*)/gm, '$2');
45
+
43
46
  // Replace unrecognized <someTag> with `"<someTag>"`
44
- const processed = code.replace(/<([a-z][a-z0-9]+)>/gi, (match, tag) => {
47
+ processed = processed.replace(/<([a-z][a-z0-9]+)>/gi, (match, tag) => {
45
48
  const known = KNOWN_COMPONENTS.includes(tag);
46
49
  return known ? match : `\`<${tag}>\``; // wrap in backticks to keep as code
47
50
  });