Skip to content
This repository has been archived by the owner on Jun 3, 2024. It is now read-only.

Commit

Permalink
highlight_config.dark bool -> highlight_config.theme
Browse files Browse the repository at this point in the history
  • Loading branch information
wbrgss committed Jun 12, 2019
1 parent c008baa commit a3b73e5
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/components/Markdown.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,17 @@ class DashMarkdown extends Component {
return (
<div
id={id}
ref={(node) => { this.mdContainer = node; }}
ref={node => {
this.mdContainer = node;
}}
style={style}
className={
((highlight_config && highlight_config.dark) ||
((highlight_config && highlight_config.theme) ||
className) &&
`${className ? className : ''} ${
highlight_config && highlight_config.dark
highlight_config &&
highlight_config.theme &&
highlight_config.theme === 'dark'
? 'hljs-dark'
: ''
}`
Expand Down Expand Up @@ -113,7 +117,9 @@ DashMarkdown.propTypes = {
/**
* Config options for syntax highlighting.
*/
highlight_config: PropTypes.object,
highlight_config: PropTypes.exact({
theme: PropTypes.oneOf(['dark', 'light']),
}),

/**
* Object that holds the loading state object coming from dash-renderer
Expand Down Expand Up @@ -141,6 +147,7 @@ DashMarkdown.propTypes = {

DashMarkdown.defaultProps = {
dangerously_allow_html: false,
highlight_config: {},
};

export default DashMarkdown;

0 comments on commit a3b73e5

Please sign in to comment.