Minecraft Wiki
Advertisement
This is the documentation page. It should be transcluded into the main script page. See Template:Documentation for more information

Makes external links and wikilinks (including interwiki) clickable in code blocks (anything with a class of mw-code).

Usage[]

// [[User:Majr/codeLinks.js]]
importScript( 'User:Majr/codeLinks.js' );

By default this applies to anything that looks like a link, however this can be limited to only comments by adding mcw.onlyLinkComment = true; before the importScript line. This requires a syntax highlighting script to mark comments with a "comment" class; Prism.js works out of the box, other highlighters may require the link script to be edited to look for a different class.

Adding the following styling to your usercss will allow the links to retain their colouring (from syntax highlighters), and also add an underline to them so it's still obvious they're clickable.

.mw-code a:not(:hover) {
    color: inherit;
    text-decoration: underline;
}



Advertisement