diff --git a/src/index.ts b/src/index.ts index a7aca15..35d9a37 100644 --- a/src/index.ts +++ b/src/index.ts @@ -167,7 +167,7 @@ export default function ofm() { const alias = rawAlias?.slice(1).trim(); // internal link - const url = sluggify(fp + anchor) + const url = encodeURIComponent(fp) + anchor; return { type: "link", url, @@ -276,7 +276,7 @@ export default function ofm() { title, }, }, - children: firstChild.children, + children: [firstChild.children[0], ...node.children.slice(1)], } } })