Origami Frontend Components & Services

JSDoc: o-syntax-highlight

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

Switch component view

GitHub Repository

Install o-syntax-highlight

If using the Build Service, add o-syntax-highlight@^2.1.0 to your script and link tags.

If running a Manual Build, run bower install --save "o-syntax-highlight@^2.1.0".

Help & Support

o-syntax-highlight is maintained directly by the Origami team. If you have any questions about o-syntax-highlight or Origami in general, we are happy to help. 😊

Slack: #ft-origami
Email: origami.support@ft.com

Feedback / Issues

To report a bug or request features please create an issue on Github. For support or general feedback please get in touch 😊

Slack: #ft-origami
Email: origami.support@ft.com