mirror of
https://github.com/Stone-Red-Code/website.git
synced 2026-09-04 09:15:58 +02:00
added client side syntax highlighting
added client side syntax highlighting removed unnecessary packages
This commit is contained in:
committed by
Jean-Philippe Sirois
parent
94e6a95037
commit
569146446e
@@ -1,5 +1,10 @@
|
||||
import React from "react"
|
||||
import * as SC from "./styles"
|
||||
import Prism from "prismjs"
|
||||
import "prismjs/components/prism-python"
|
||||
import "prismjs/components/prism-markup-templating"
|
||||
import "prismjs/components/prism-php"
|
||||
import "prismjs/plugins/line-numbers/prism-line-numbers.css"
|
||||
|
||||
interface MarkdownProps {
|
||||
content: string
|
||||
@@ -13,6 +18,9 @@ export function Markdown({
|
||||
content,
|
||||
...restProps
|
||||
}: MarkdownProps): JSX.Element {
|
||||
React.useEffect(() => {
|
||||
Prism.highlightAll()
|
||||
}, [])
|
||||
return (
|
||||
<SC.MarkdownWrapper
|
||||
dangerouslySetInnerHTML={{ __html: content }}
|
||||
|
||||
Reference in New Issue
Block a user