How to use the prismjs.highlightAllUnder function in prismjs

To help you get started, we’ve selected a few prismjs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github storybookjs / design-system / src / components / Highlight.js View on Github external
highlightCode() {
    const domNode = ReactDOM.findDOMNode(this); // eslint-disable-line
    Prism.highlightAllUnder(domNode);
  }
github freeCodeCamp / freeCodeCamp / client / src / templates / Challenges / components / Challenge-Description.js View on Github external
componentDidMount() {
    // Just in case 'current' has not been created, though it should have been.
    if (this.instructionsRef.current) {
      Prism.highlightAllUnder(this.instructionsRef.current);
    }
  }
github tutsprime / laravel-qa / resources / js / mixins / highlight.js View on Github external
highlight (id = "") {
            let el;
            if (!id) {
                el = this.$refs.bodyHtml;        
            } else {
                el = document.getElementById(id);
            }
            console.log('el', el);
            if (el) Prism.highlightAllUnder(el);
        }
    }
github yanthink / blog / src / routes / Admin / Article / Form.js View on Github external
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;
  };
github netlify / netlify-cms / website / src / cms / cms.js View on Github external
highlight() {
      Prism.highlightAllUnder(this.ref.current);
    }
github cypress-io / cypress / packages / reporter / src / errors / error-code-frame.jsx View on Github external
componentDidMount () {
    Prism.highlightAllUnder(this.refs.codeFrame)
  }
github bayareawebpro / laravel-micro.js / docs-src / js / Components / v-code.vue View on Github external
highlight(){
				Prism.highlightAllUnder(this.$refs.highlight)
			}
		},
github yanthink / blog / src / routes / Article / Details.js View on Github external
    this.setState({ article }, () => Prism.highlightAllUnder(this.markdownDomNode));
  }
github GitOfZGT / zero-design / zerod / components / ZcodeHighlight / index.jsx View on Github external
componentDidMount() {
		const { children, mode } = this.props;
		if (children) {
			if (children && mode === "html") {
				const childHtml = children.replace(/\