Skip to content

Commit

Permalink
Fix api ref links
Browse files Browse the repository at this point in the history
  • Loading branch information
petyosi committed Feb 6, 2024
1 parent 23b5e4f commit d1386bb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app/editor/api/[[...slug]]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,12 @@ export default function Page({ params }: { params: PageParams }) {
if (node.type == 'element' && node.tagName === 'a') {
let href = node.properties!.href as string
href = href.replace(/\.md$/, '').replace('README.md', '')
node.properties!.href = `/editor/api/${href}`

// relative links are ok
if (!href.startsWith('..')) {
href = `/editor/api/${href}`
}
node.properties!.href = href
}
},
},
Expand Down
5 changes: 5 additions & 0 deletions app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,11 @@
@apply mb-4;
}
}

a > code {
text-decoration: none;
border-bottom: 1px dotted var(--blue9);
}
}

.full-demo-mdxeditor [role=toolbar] {
Expand Down

0 comments on commit d1386bb

Please sign in to comment.