Skip to content

Commit d75c2cc

Browse files
committed
fix(previews): pass file extension to markdown component for proper rendering
1 parent d417f29 commit d75c2cc

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/pages/home/previews/markdown_with_word_wrap.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
11
import { Markdown, MaybeLoading } from "~/components"
22
import { useFetchText } from "~/hooks"
3+
import { objStore } from "~/store"
4+
import { ext } from "~/utils"
35

46
const MdPreview = () => {
57
const [content] = useFetchText()
68
return (
79
<MaybeLoading loading={content.loading}>
8-
<Markdown class="word-wrap" children={content()?.content} toc />
10+
<Markdown
11+
class="word-wrap"
12+
children={content()?.content}
13+
ext={ext(objStore.obj.name)}
14+
toc
15+
/>
916
</MaybeLoading>
1017
)
1118
}

0 commit comments

Comments
 (0)