User:Majr/codeLinks.js/doc

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  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; }