mirror of
https://github.com/hanzo-docs/docs.git
synced 2026-10-26 23:49:51 +00:00
Core: Fix remark-dynamic-content
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"fumadocs-core": patch
|
||||
---
|
||||
|
||||
Fix remark-dynamic-content ignored code blocks
|
||||
@@ -36,10 +36,12 @@ export function remarkDynamicContent(
|
||||
|
||||
return (tree) => {
|
||||
visit(tree, filter, (node) => {
|
||||
if (!('value' in node) || typeof node.value === 'string') return;
|
||||
const canReplace = 'value' in node && typeof node.value === 'string';
|
||||
if (!canReplace) return;
|
||||
|
||||
const result = regex.exec(node.value);
|
||||
|
||||
if (result?.groups?.path) {
|
||||
if (result) {
|
||||
const dest = path.resolve(cwd, result[1]);
|
||||
let value = fs.readFileSync(dest).toString();
|
||||
if (trim) value = value.trim();
|
||||
|
||||
Reference in New Issue
Block a user