Bunoon: LIGHT | Manual | Highlight Functions

This area contains the functions that are used for the different types of syntax highlighting that are currently supported. YOu can either looked specifically at a single element, or a group of elements based on a class name and type.

Looks up an element by ID (or just the element itself) and tries to correctly format its innerHTML.

The main arguments for this function are as follows:

  • sHTML [String] - The HTML that is to be adjusted.
  • sLanguage [String] - The name of the language that is being used.

The return value for this function is as follows:

  • [Object] - The new formatted HTML (or null if an error has occurred)

Below is an example of how to use this function:

var sHTML = $L.ForHTML('TestCode', 'JavaScript');"

Looks up an element by ID (or just the element itself) and tries to correctly format its innerHTML.

The main arguments for this function are as follows:

  • oIdentifier [Object] - The ID of the element or the element itself.
  • sLanguage [String] - The name of the language that is being used.

The return value for this function is as follows:

  • [Boolean] - An boolean of true/false to state of we have completed the operation.

Below is an example of how to use this function:

var bResult = $L.ForElement('ElementID', 'JavaScript');"

Gets elements from the document (or other element) by class name and tries to correctly format their innerHTML.

The main arguments for this function are as follows:

  • sClassName [String] - The name of the class used by the elements to look up.
  • sType [String] - The type of the elements we are looking up (defaults to * for all).
  • sLanguage [String] - The name of the language that is being used.

The return value for this function is as follows:

  • [Boolean] - An boolean of true/false to state of we have completed the operation.

Below is an example of how to use this function:

var bResult = $L.ForAllElements('ElementsClassName', 'div', 'JavaScript');