lib/highlight.js
function highlightHTML(code = '') {
  if (!code) {
    return '';
  }
  const { dom, lines } = highlight(code);

  return dom.html(lines);
}
function highlightHTML(code = '') {
  if (!code) {
    return '';
  }
  const { dom, lines } = highlight(code);

  return dom.html(lines);
}
function highlightHTML ( code = '' ) { if ( ! code ) { return '' ; } const { dom , lines } = highlight ( code ) ; return dom . html ( lines ) ; }
Using the CodeMirror editor highlights a string of text representing JavaScript program code and returns an HTML
string.

@memberof module:highlight
@method highlightHTML
@param {string} [code=""] - any valid ES2015, TypeScript, JSX, Flow code
@return {string} an HTML string of the `pre.CodeMirror-line` elements
@example
import {highlightHTML} from 'webcompiler';
// or - import {highlightHTML} from 'webcompiler/lib/highlight';
// or - var highlightHTML = require('webcompiler').highlightHTML;
// or - var highlightHTML = require('webcompiler/lib/highlight').highlightHTML;

highlightHTML('function myScript(){return 100;}'); // <pre class="CodeMirror-line">...</pre>
Using the CodeMirror editor highlights a string of text representing JavaScript program code and returns an HTML string .