Use `class="free external"` only on unbracketed URLs
authorC. Scott Ananian <cscott@cscott.net>
Wed, 28 Feb 2018 21:11:09 +0000 (16:11 -0500)
committerC. Scott Ananian <cscott@cscott.net>
Wed, 7 Mar 2018 05:20:09 +0000 (00:20 -0500)
commit65fcb7a94528ea56d461b3c7b9cb4d4fe4e99211
tree63875f1973f6642c4e54f2f2c06c7ca11149e652
parentdc6c5002cf22f8c9bc0d5ee6ce773c1c4a77ba35
Use `class="free external"` only on unbracketed URLs

The ability for URLs to be marked free even if they use bracketed syntax
but "sorta look free" (aka unbracketed) was added 13 years ago in
2d71cb30802e5cb78a423a1699ad87e23bfe9f4e (r7074).

It seemed like a reasonable idea at the time: make printed output a little
prettier by marking "sorta free" URLs as free.  But this complicates the
semantics of wikitext, and introduces all sorts of strange corner cases,
for example:

  [http://example.com/&amp; http://example.com/&]

isn't marked as free, even though the parser output is:

  <a rel="nofollow" class="external text" href="http://example.com/&amp;">http://example.com/&amp;</a>

This functionality isn't actually needed: if you want the pretty printed
output of an unbracketed URL, then actually use an unbracketed URL.

In recent years we're more concerned with simplifying the semantics of
wikitext and eliminating corner cases, such that the content of our wikis
can be effectively archived.  The "effectively free" URLs are low-hanging
fruit in this quest.

Change-Id: I339e8698786c60c96a37a73443cb9a04362662c4
RELEASE-NOTES-1.31
includes/parser/Parser.php
tests/parser/parserTests.txt