lib/highlight.js
function highlight(value) {
  const el = document.createElement('div');

  cm(el, { value, mode: { name: 'jsx', typescript: true }, scrollbarStyle: 'null', inputStyle: 'contenteditable' });

  const dom = (0, _cheerio.load)(el.innerHTML),
        lines = dom('.CodeMirror-line');

  // eslint-disable-next-line lodash/prefer-lodash-method
  lines.find('> span').removeAttr('style');

  return { dom, lines };
}
function highlight(value) {
  const el = document.createElement('div');

  cm(el, { value, mode: { name: 'jsx', typescript: true }, scrollbarStyle: 'null', inputStyle: 'contenteditable' });

  const dom = (0, _cheerio.load)(el.innerHTML),
        lines = dom('.CodeMirror-line');

  // eslint-disable-next-line lodash/prefer-lodash-method
  lines.find('> span').removeAttr('style');

  return { dom, lines };
}
function highlight ( value ) { const el = document . createElement ( 'div' ) ; cm ( el , { value , mode : { name : 'jsx' , typescript : true } , scrollbarStyle : 'null' , inputStyle : 'contenteditable' } ) ; const dom = ( 0 , _cheerio . load ) ( el . innerHTML ) , lines = dom ( '.CodeMirror-line' ) ; // eslint-disable-next-line lodash/prefer-lodash-method lines . find ( '> span' ) . removeAttr ( 'style' ) ; return { dom , lines } ; }
Using the CodeMirror editor highlights a string of text representing JavaScript program code.

@memberof module:highlight
@private
@method highlight
@param {string} value - any valid ES2015, TypeScript, JSX, Flow code
@return {Object} an object containing a CheerioDOM object and a CheerioCollection of the `pre.CodeMirror-line`
elements
Using the CodeMirror editor highlights a string of text representing JavaScript program code .