Some months ago, Stack Exchange moved to highlight.js v11. One of the breaking changes of this version was the removal of the HTML auto-passthru, which SE uses to indicate addition/deletion in diffs (that is, nested spans in code elements). As a result, highlighting broke in code blocks for diffs.

The bug was reported on MSO and MSE. A week later, a "hotfix" was pushed which has been out for... 2 months! Essentially, it disabled highlight.js entirely on the pages where there were diffs (revisions and suggested edits).

What is this?

This is a highlight.js plugin. The idea as well as a large part of the code have been taken from this GitHub issue.


From revisions:

Diff highlighting in revisions

From suggested edits:

Diff highlighting in suggested edits


The script is licensed under the GPL-3.0-or-later license.


GitHub | Install


The script should work in most browsers and userscript managers. It has been tested on Chrome using Tampermonkey.


You can add an answer or comment below or create a GitHub issue.

You must log in to answer this question.

Browse other questions tagged .