new SyntaxHighlight(...)

Class constructor.

parameter type default description
messageElement (optional) HTMLElement | String The message element in the DOM
options (optional) Object {} An options object for configuring the message
options.language String The language to tokenise the code for

Methods

Links

SyntaxHighlight#tokenise

Instance Method

Tokenise string for highlighting

Returns

  • HTMLElement - tokenised code in the form of HTML elements

Links

SyntaxHighlight.init(rootElement, options)

Static Method

Initialise syntax highlighting.

parameter type default description
rootElement HTMLElement | String The root element to intialise a message in, or a CSS selector for the root element
options (optional) Object {} An options object for configuring the syntax highlighting

Links