Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
highlightCode() {
const domNode = ReactDOM.findDOMNode(this); // eslint-disable-line
Prism.highlightAllUnder(domNode);
}
componentDidMount() {
// Just in case 'current' has not been created, though it should have been.
if (this.instructionsRef.current) {
Prism.highlightAllUnder(this.instructionsRef.current);
}
}
highlight (id = "") {
let el;
if (!id) {
el = this.$refs.bodyHtml;
} else {
el = document.getElementById(id);
}
console.log('el', el);
if (el) Prism.highlightAllUnder(el);
}
}
renderMarkdown = text => {
const html = marked(text, { breaks: true });
if (/language-/.test(html)) {
const container = document.createElement('div');
container.innerHTML = html;
Prism.highlightAllUnder(container);
return container.innerHTML;
}
return html;
};
highlight() {
Prism.highlightAllUnder(this.ref.current);
}
componentDidMount () {
Prism.highlightAllUnder(this.refs.codeFrame)
}
highlight(){
Prism.highlightAllUnder(this.$refs.highlight)
}
},
this.setState({ article }, () => Prism.highlightAllUnder(this.markdownDomNode));
}
componentDidMount() {
const { children, mode } = this.props;
if (children) {
if (children && mode === "html") {
const childHtml = children.replace(/\