diff options
author | Fabio Berger <me@fabioberger.com> | 2018-03-02 21:40:26 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2018-03-02 21:40:26 +0800 |
commit | 67c834841ea0f8fb4d8d194c0f68802f48e764ee (patch) | |
tree | 1cea9006d0b572318d1d0784f97eee8b85a413c8 /packages/website/ts/pages/shared/markdown_section.tsx | |
parent | edaa0b0e34f99b0d34405eecb6aee54c1f6d7c7e (diff) | |
download | dexon-sol-tools-67c834841ea0f8fb4d8d194c0f68802f48e764ee.tar dexon-sol-tools-67c834841ea0f8fb4d8d194c0f68802f48e764ee.tar.gz dexon-sol-tools-67c834841ea0f8fb4d8d194c0f68802f48e764ee.tar.bz2 dexon-sol-tools-67c834841ea0f8fb4d8d194c0f68802f48e764ee.tar.lz dexon-sol-tools-67c834841ea0f8fb4d8d194c0f68802f48e764ee.tar.xz dexon-sol-tools-67c834841ea0f8fb4d8d194c0f68802f48e764ee.tar.zst dexon-sol-tools-67c834841ea0f8fb4d8d194c0f68802f48e764ee.zip |
Update react-markdown, properly scroll to section for wiki internal links, consolidate scrollTo logic and make external links open in new tabs
Diffstat (limited to 'packages/website/ts/pages/shared/markdown_section.tsx')
-rw-r--r-- | packages/website/ts/pages/shared/markdown_section.tsx | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/packages/website/ts/pages/shared/markdown_section.tsx b/packages/website/ts/pages/shared/markdown_section.tsx index 4d7d8b4ca..7253072d9 100644 --- a/packages/website/ts/pages/shared/markdown_section.tsx +++ b/packages/website/ts/pages/shared/markdown_section.tsx @@ -5,6 +5,7 @@ import * as ReactMarkdown from 'react-markdown'; import { Element as ScrollElement } from 'react-scroll'; import { AnchorTitle } from 'ts/pages/shared/anchor_title'; import { MarkdownCodeBlock } from 'ts/pages/shared/markdown_code_block'; +import { MarkdownLinkBlock } from 'ts/pages/shared/markdown_link_block'; import { HeaderSizes } from 'ts/types'; import { colors } from 'ts/utils/colors'; import { utils } from 'ts/utils/utils'; @@ -64,7 +65,14 @@ export class MarkdownSection extends React.Component<MarkdownSectionProps, Markd </div> </div> <hr style={{ border: `1px solid ${colors.lightestGrey}` }} /> - <ReactMarkdown source={this.props.markdownContent} renderers={{ CodeBlock: MarkdownCodeBlock }} /> + <ReactMarkdown + source={this.props.markdownContent} + escapeHtml={false} + renderers={{ + code: MarkdownCodeBlock, + link: MarkdownLinkBlock, + }} + /> </ScrollElement> </div> ); |