We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1ba082e commit 94ff5b0Copy full SHA for 94ff5b0
utils/mdToHtml.tsx
@@ -1,8 +1,27 @@
1
import { ComponentProps } from 'react';
2
+import { useTextStyles } from '@rescui/typography';
3
import MD2Markdown from 'markdown-to-jsx';
4
5
export type MarkdownProps = ComponentProps<typeof MD2Markdown>;
6
7
export function Markdown(props: MarkdownProps) {
- return <MD2Markdown {...props} />;
8
+ const textCn = useTextStyles();
9
+ const linkClass = textCn('rs-link');
10
+ const overriddenClassNamesForTags = {
11
+ a: {
12
+ props: {
13
+ className: linkClass
14
+ }
15
16
+ };
17
+ return <MD2Markdown
18
+ {...props}
19
+ options={{
20
+ ...props.options,
21
+ overrides: {
22
+ ...props.options?.overrides,
23
+ ...overriddenClassNamesForTags
24
25
+ }}
26
+ />;
27
}
0 commit comments