chore: not opening in new tab

This commit is contained in:
wonderlandpark 2021-03-07 13:28:56 +09:00
parent dd150eb3e5
commit 59f6477719
2 changed files with 6 additions and 2 deletions

View File

@ -3,7 +3,7 @@ import MarkdownView from 'react-showdown'
import sanitizeHtml from 'sanitize-html'
import Emoji from 'node-emoji'
const Markdown = ({ text }: MarkdownProps): JSX.Element => {
const Markdown = ({ text, options={} }: MarkdownProps): JSX.Element => {
return (
<div className='markdown-body w-full'>
<MarkdownView
@ -21,6 +21,7 @@ const Markdown = ({ text }: MarkdownProps): JSX.Element => {
tasklists: true,
ghCompatibleHeaderId: true,
encodeEmails: true,
...options
}}
sanitizeHtml={html =>
sanitizeHtml(html, {
@ -104,6 +105,9 @@ const Markdown = ({ text }: MarkdownProps): JSX.Element => {
interface MarkdownProps {
text: string
options?: {
[key: string]: boolean
}
}
export default Markdown

View File

@ -27,7 +27,7 @@ const Docs: NextPage<DocsProps> = ({ docs }) => {
if((!document) || router.query.docs?.length > 2) return <NotFound />
return <DeveloperLayout enabled='docs' docs={docs} currentDoc={(router.query.second || router.query.first) as string}>
<div className='px-2 no-seg'>
<Markdown text={document?.text} />
<Markdown text={document?.text} options={{ openLinksInNewWindow: false }}/>
</div>
</DeveloperLayout>
}