Last edited · 2 revisions  

 


From the Github Markdown cheatsheet
Code and Syntax Highlighting

var s = "JavaScript syntax highlighting";
alert(s);

Syntax highlighting seems to work in forum posts, but not in Wiki posts.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

EDIT: Example from highlight.js demo

function $initHighlight(block, cls) {
  try {
    if (cls.search(/\bno\-highlight\b/) != -1)
      return process(block, true, 0x0F) +
             ` class="${cls}"`;
  } catch (e) {
    /* handle exception */
  }
  for (var i = 0 / 2; i < classes.length; i++) {
    if (checkCondition(classes[i]) === undefined)
      console.log('undefined');
  }
}

export  $initHighlight;