dev

SyntaxHighlight is a forked version of Syntax highlighter script made by Remember the dot on MediaWiki.org.

It brings back old syntax highlighting available on Fandom's legacy platform and makes it available in source editor, also referred to as WikiEditor or 2010 wikitext editor.

Installation

Usage

In order to use this script you have to make sure that you're using 2010 editor by going to your editor preferences and changing preferred editor to "Source editor".

"Source editor" must be your preferred editor

"Source editor" must be your preferred editor

Then, you have to disable editor's built-in syntax highlighter by clicking the marker icon in the editor's toolbar.

Make sure that marker icon is not active

Make sure that marker icon is not active

Configuration

Script supports various customization options to control both its appearance and behavior.

Colors

Script is configured to fit in all Fandom wikis with all color schemes using the same set of colors as on legacy Fandom platform:

Light wikis


Dark wikis


Custom colors

It is, however, possible to customize your wiki's highlighting options by editing window.syntaxHighlighterConfig object and adding it to MediaWiki:Common.js or MediaWiki:Fandomdesktop.js page on your wiki. Following keys are accepted:

window.syntaxHighlighterConfig = {
    boldOrItalicColor: '',
    commentColor: '',
    entityColor: '',
    externalLinkColor: '',
    headingColor: '',
    hrColor: '',
    listOrIndentColor: '',
    parameterColor: '',
    signatureColor: '',
    tagColor: '',
    tableColor: '',
    templateColor: '',
    wikilinkColor: ''
};

Example configuration:

window.syntaxHighlighterConfig = {
    externalLinkColor: '#FFCC66',
    wikilinkColor: '#E6FFFF'
}

Other options

You can learn more about other customization options available in this script on Syntax highlighter documentation.

Original script

Original source code of this script is available on page User:Remember the dot/Syntax highlighter.js on MediaWiki.org and was created by Remember the dot and other contributors. It is used on MediaWiki.org and other Wikimedia Foundation wikis as a gadget.

A version of the original upon which this script has been based can be found in the top comment on MediaWiki:SyntaxHighlight.js.

If you think you found a generic issue with this script that is not related with it running specifically on Fandom, please consider making an upstream report to Remember the dot on original script's talk page.

Changes from the original

While this code aims at integrating the original script into Fandom with minimal amount of changes, there are some modifications made to this script to assure it's working correctly on Fandom and improve its performance. These include:

Possible issues

Although this script should work as-is on all Fandom wikis, some issues may occur:

External links

Text above can be found here (edit)