function /** string */ highlightLine(/** string */ line, /** number */ index) {
  const content = line // First escape HTML entities then do the highlighting..
    .replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;')
    .replace(rString,   '<span class="string">$&</span>')
    .replace(rComment,  '<span class="comment">$&</span>')
    .replace(rOperator, '<span class="operator">$&</span>')
    .replace(rKeyword,  '<span class="keyword">$&</span>')
    .replace(rRegister, '<span class="register">$&</span>')
    .replace(rNumber,   '<span class="number">$&</span>');
  return `<span id="line${index+1}">${content}</span><br>`;
}
/// TODO: Shouldn't match escaped HTML

Shouldn't match escaped HTML
Shouldn ' t match escaped HTML
function  highlightLine( line,  index) {
  const content = line 
    .replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;')
    .replace(rString,   '<span class="string">$&</span>')
    .replace(rComment,  '<span class="comment">$&</span>')
    .replace(rOperator, '<span class="operator">$&</span>')
    .replace(rKeyword,  '<span class="keyword">$&</span>')
    .replace(rRegister, '<span class="register">$&</span>')
    .replace(rNumber,   '<span class="number">$&</span>');
  return `<span id="line${index+1}">${content}</span><br>`;
}
function highlightLine ( line , index ) { const content = line . replace ( / & / g , '&amp;' ) . replace ( / < / g , '&lt;' ) . replace ( / > / g , '&gt;' ) . replace ( rString , '<span class="string">$&</span>' ) . replace ( rComment , '<span class="comment">$&</span>' ) . replace ( rOperator , '<span class="operator">$&</span>' ) . replace ( rKeyword , '<span class="keyword">$&</span>' ) . replace ( rRegister , '<span class="register">$&</span>' ) . replace ( rNumber , '<span class="number">$&</span>' ) ; return ` ${ index + 1 } ${ content } ` ; }
TODO: Shouldn't match escaped HTML
TODO : Shouldn ' t match escaped HTML
/** string */ /** string */ /** number */ // First escape HTML entities then do the highlighting..
