mirror of
https://github.com/koreanbots/core.git
synced 2025-12-16 14:30:22 +00:00
chore: not opening in new tab
This commit is contained in:
parent
dd150eb3e5
commit
59f6477719
@ -3,7 +3,7 @@ import MarkdownView from 'react-showdown'
|
|||||||
import sanitizeHtml from 'sanitize-html'
|
import sanitizeHtml from 'sanitize-html'
|
||||||
import Emoji from 'node-emoji'
|
import Emoji from 'node-emoji'
|
||||||
|
|
||||||
const Markdown = ({ text }: MarkdownProps): JSX.Element => {
|
const Markdown = ({ text, options={} }: MarkdownProps): JSX.Element => {
|
||||||
return (
|
return (
|
||||||
<div className='markdown-body w-full'>
|
<div className='markdown-body w-full'>
|
||||||
<MarkdownView
|
<MarkdownView
|
||||||
@ -21,6 +21,7 @@ const Markdown = ({ text }: MarkdownProps): JSX.Element => {
|
|||||||
tasklists: true,
|
tasklists: true,
|
||||||
ghCompatibleHeaderId: true,
|
ghCompatibleHeaderId: true,
|
||||||
encodeEmails: true,
|
encodeEmails: true,
|
||||||
|
...options
|
||||||
}}
|
}}
|
||||||
sanitizeHtml={html =>
|
sanitizeHtml={html =>
|
||||||
sanitizeHtml(html, {
|
sanitizeHtml(html, {
|
||||||
@ -104,6 +105,9 @@ const Markdown = ({ text }: MarkdownProps): JSX.Element => {
|
|||||||
|
|
||||||
interface MarkdownProps {
|
interface MarkdownProps {
|
||||||
text: string
|
text: string
|
||||||
|
options?: {
|
||||||
|
[key: string]: boolean
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default Markdown
|
export default Markdown
|
||||||
|
|||||||
@ -27,7 +27,7 @@ const Docs: NextPage<DocsProps> = ({ docs }) => {
|
|||||||
if((!document) || router.query.docs?.length > 2) return <NotFound />
|
if((!document) || router.query.docs?.length > 2) return <NotFound />
|
||||||
return <DeveloperLayout enabled='docs' docs={docs} currentDoc={(router.query.second || router.query.first) as string}>
|
return <DeveloperLayout enabled='docs' docs={docs} currentDoc={(router.query.second || router.query.first) as string}>
|
||||||
<div className='px-2 no-seg'>
|
<div className='px-2 no-seg'>
|
||||||
<Markdown text={document?.text} />
|
<Markdown text={document?.text} options={{ openLinksInNewWindow: false }}/>
|
||||||
</div>
|
</div>
|
||||||
</DeveloperLayout>
|
</DeveloperLayout>
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user