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_code_block.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_code_block.tsx')
-rw-r--r-- | packages/website/ts/pages/shared/markdown_code_block.tsx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/packages/website/ts/pages/shared/markdown_code_block.tsx b/packages/website/ts/pages/shared/markdown_code_block.tsx index 98ca3aee6..6dfb74554 100644 --- a/packages/website/ts/pages/shared/markdown_code_block.tsx +++ b/packages/website/ts/pages/shared/markdown_code_block.tsx @@ -3,7 +3,7 @@ import * as React from 'react'; import * as HighLight from 'react-highlight'; interface MarkdownCodeBlockProps { - literal: string; + value: string; language: string; } @@ -13,12 +13,12 @@ export class MarkdownCodeBlock extends React.Component<MarkdownCodeBlockProps, M // Re-rendering a codeblock causes any use selection to become de-selected. This is annoying when trying // to copy-paste code examples. We therefore noop re-renders on this component if it's props haven't changed. public shouldComponentUpdate(nextProps: MarkdownCodeBlockProps, nextState: MarkdownCodeBlockState) { - return nextProps.literal !== this.props.literal || nextProps.language !== this.props.language; + return nextProps.value !== this.props.value || nextProps.language !== this.props.language; } public render() { return ( <span style={{ fontSize: 14 }}> - <HighLight className={this.props.language || 'javascript'}>{this.props.literal}</HighLight> + <HighLight className={this.props.language || 'javascript'}>{this.props.value}</HighLight> </span> ); } |