Skip to content

Commit 1b8cf81

Browse files
committed
fix: dokument vocab link renderings
1 parent 72f5617 commit 1b8cf81

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

src/pages/blog-views/DokumentBlogPostPage.jsx

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -314,12 +314,22 @@ const DokumentBlogPostPage = () => {
314314
remarkPlugins={[remarkGfm, remarkMath]}
315315
rehypePlugins={[rehypeRaw, rehypeKatex]}
316316
components={{
317-
a: (p) => (
318-
<MarkdownLink
319-
{...p}
320-
className="font-bold underline decoration-emerald-600/30 hover:decoration-emerald-600"
321-
/>
322-
),
317+
a: (p) => {
318+
const isVocab =
319+
p.href &&
320+
(p.href.startsWith('/vocab/') ||
321+
p.href.includes('/#/vocab/'));
322+
return (
323+
<MarkdownLink
324+
{...p}
325+
className={
326+
isVocab
327+
? 'font-bold text-black bg-emerald-300 px-1 hover:bg-emerald-700 hover:text-white transition-all cursor-help no-underline'
328+
: 'font-bold underline decoration-emerald-600/30 hover:decoration-emerald-600 text-emerald-800'
329+
}
330+
/>
331+
);
332+
},
323333
pre: ({ children }) => <>{children}</>,
324334
code: CodeBlock,
325335
}}

0 commit comments

Comments
 (0)