Open main menu

Help:Extension:Linter/wikilink-in-extlink

< Help:Extension:Linter

This linter error is reported when a wikilink is used inside an external link. This usage is not semantically correct and will not render as expected since it is not possible to nest a link inside a link.

ExampleEdit
[http://google.com This is [[Google]]'s search page]

The generated HTML for this is:

<a rel="nofollow" class="external text" href="http://google.com">This is </a><a href="Google" title="Google">Google</a>'s search page

As you see, the HTML output has a pair of links adjacent to each other, the first one being an external link and the second one a wiki link and includes text that is not linked at all. Presumably, this output is not what editors intended and the wikitext needs to be fixed to remove the semantically incorrect link nesting.

How to fixEdit

Typical fixes:

  • Remove the square brackets from the non-working wikilink. In the example above, that would look like: [http://google.com This is Google's search page]
  • Move the wikilink outside of the single square brackets that form the external link for the URL. This may require some minor copy editing so that that resulting text and links make sense. In the example above, that might look like: [http://google.com This] is [[Google]]'s search page