Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
highlight={code => highlight(code, languages.js)}
// padding={10}
const highlight = (code) => Prism.highlight(code, Prism.languages.jsx, 'jsx');
_highlight = (code: string) => {
if (this.props.path.endsWith('.ts') || this.props.path.endsWith('.tsx')) {
return highlight(code, languages.ts);
} else if (this.props.path.endsWith('.js')) {
return highlight(code, languages.jsx);
} else if (this.props.path.endsWith('.json')) {
return highlight(code, languages.json);
} else if (this.props.path.endsWith('.md')) {
return highlight(code, languages.markdown);
}
return escape(code);
};
_highlight = code => {
if (this.props.path.endsWith('.js')) {
return highlight(code, languages.jsx);
} else if (this.props.path.endsWith('.json')) {
return highlight(code, languages.json);
} else if (this.props.path.endsWith('.md')) {
return highlight(code, languages.markdown);
}
return escape(code);
};
module.exports = (code, language = 'jsx') =>
highlight(code, languages[language] || languages.text)
highlight={code => isHieghtlight ? highlight(code, languages.yaml, 'yaml') : code}
padding={10}
highlight={code => highlight(code, languages.json)}
onValueChange={this.handleChangeBound}
const prism = (code, language = 'jsx') => highlight(code, languages[language])