RubyFlow The Ruby and Rails community linklog

×

The Ruby and Rails community linklog

Made a library? Written a blog post? Found a useful tutorial? Share it with the Ruby community here or just enjoy what everyone else has found!

Introducing highlightjs-turbolinks, a turbolinks 5 compatible fork of highlight.js

Highlightjs-turbolinks is a Turbolinks 5 compatible fork of Highlight.js, and is up to date with v9.12.0.

https://github.com/ajwann/highlightjs-turbolinks

https://www.npmjs.com/package/highlightjs-turbolinks

To make Highlight.js compatible with Turbolinks 5, two event listeners have been added to initHighlightingOnLoad, which listen for the turbolinks:load and turbolinks:render events.

The original event listeners used by initHighlightingOnLoad have been left in place. They listen for the DOMContentLoaded and load events. This allows highlight-js-turbolinks to be compatible with applications that use turbolinks, and also compatable with applications that do not. Therefore if you ever choose to disable or remove turbolinks from your application, you may continue to use highlightjs-turbolinks.

Post a comment

You can use basic HTML markup (e.g. <a>) or Markdown.

As you are not logged in, you will be
directed via GitHub to signup or sign in