Code Example

Code highlighting requires the JavaScript libraries, so you need to use one of the MasterPages or layouts that will load them. (When this page is loaded with BSSeattlePure, it just looks like "normal" text.)

This is the method usually used with preformatted text blocks.

   
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;   

This is the method used when you do not want to use preformatted text. In this case, DIVs or BR tags are used to break lines,

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;