Skip to content

Commit

Permalink
Add support to open in new tab inside editor's preview mode (octokath…
Browse files Browse the repository at this point in the history
  • Loading branch information
morizkay authored Aug 17, 2021
1 parent 61be591 commit ed994da
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion components/PreviewColumn.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import ReactMarkdown from 'react-markdown'

import { TAB } from '../utils/constants'
import RawPreview from './RawPreview'

Expand All @@ -19,7 +20,17 @@ export const PreviewColumn = ({ selectedSectionSlugs, getTemplate, selectedTab }
}`}
>
{showPreview ? (
<ReactMarkdown plugins={[gfm]} children={markdown} />
<ReactMarkdown
plugins={[gfm]}
children={markdown}
renderers={{
link: (props) => (
<a href={props.href} target="_blank">
{props.children}
</a>
),
}}
/>
) : (
<RawPreview text={markdown} />
)}
Expand Down

0 comments on commit ed994da

Please sign in to comment.