mirror of
https://github.com/koreanbots/core.git
synced 2025-12-15 22:10:24 +00:00
feat: added hljs
This commit is contained in:
parent
85c82bb9d4
commit
5aeaf1c604
@ -10,6 +10,9 @@ class MyDocument extends Document {
|
|||||||
return (
|
return (
|
||||||
<Html>
|
<Html>
|
||||||
<Head>
|
<Head>
|
||||||
|
<link rel='stylesheet'
|
||||||
|
href='//cdnjs.cloudflare.com/ajax/libs/highlight.js/10.5.0/styles/default.min.css'/>
|
||||||
|
<script src='//cdnjs.cloudflare.com/ajax/libs/highlight.js/10.5.0/highlight.min.js'></script>
|
||||||
<script
|
<script
|
||||||
data-ad-client='ca-pub-4856582423981759'
|
data-ad-client='ca-pub-4856582423981759'
|
||||||
async
|
async
|
||||||
|
|||||||
@ -8,6 +8,7 @@ import Package from '../package.json'
|
|||||||
import { anchorHeader, checkBrowser } from '../utils/Tools'
|
import { anchorHeader, checkBrowser } from '../utils/Tools'
|
||||||
import MarkdownView from 'react-showdown'
|
import MarkdownView from 'react-showdown'
|
||||||
import sanitizeHtml from 'sanitize-html'
|
import sanitizeHtml from 'sanitize-html'
|
||||||
|
import { useEffect } from 'react'
|
||||||
|
|
||||||
const ClientInfo = ( ):JSX.Element => {
|
const ClientInfo = ( ):JSX.Element => {
|
||||||
const formik = useFormik({
|
const formik = useFormik({
|
||||||
@ -28,6 +29,10 @@ https://github.com/koreanbots
|
|||||||
},
|
},
|
||||||
onSubmit: ()=>{ alert('Pong') }
|
onSubmit: ()=>{ alert('Pong') }
|
||||||
})
|
})
|
||||||
|
useEffect(()=> {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
|
window.document.querySelectorAll('pre code').forEach(el=> (window as any).hljs.highlightBlock(el))
|
||||||
|
}, [formik.values.markdown])
|
||||||
const { theme, systemTheme } = useTheme()
|
const { theme, systemTheme } = useTheme()
|
||||||
return <Container paddingTop className='mb-10'>
|
return <Container paddingTop className='mb-10'>
|
||||||
<h1 className='text-4xl font-bold mb-3 mt-3'>개발자모드</h1>
|
<h1 className='text-4xl font-bold mb-3 mt-3'>개발자모드</h1>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user