Bug 22905. Patch based on one submitted by Solitarius. Basically, we
were assuming that anything matching <a.*?</a> was a link and ignoring
it so as to avoid nested links, but that matched the HTML from
<abbr>(fr)</abbr> ISBN
2753300917 [http://www.example.com example.com]
so the ISBN didn't work. Parser test committed, fails without the
Parser.php change.
* ST47
* Scott Colcord
* Simon Walker
+* Solitarius
* Stefano Codari
* Str4nd
* svip
* (bug 18664) Relative URIs in interwiki links cause failed redirects
* (bug 19270) Relative URIs in interwiki links break interwiki transclusion
* (bug 22903) Revdelete log entries now show in the user preferred language.
+* (bug 22905) Correctly handle <abbr> followed by ISBN
== API changes in 1.17 ==
* (bug 22738) Allow filtering by action type on query=logevent
$urlChar = self::EXT_LINK_URL_CLASS;
$text = preg_replace_callback(
'!(?: # Start cases
- (<a.*?</a>) | # m[1]: Skip link text
+ (<a[ \t\r\n>].*?</a>) | # m[1]: Skip link text
(<.*?>) | # m[2]: Skip stuff inside HTML elements' . "
(\\b(?:$prots)$urlChar+) | # m[3]: Free external links" . '
(?:RFC|PMID)\s+([0-9]+) | # m[4]: RFC or PMID, capture number
</p>
!! end
+!! test
+Bug 22905: <abbr> followed by ISBN followed by </a>
+!! input
+<abbr>(fr)</abbr> ISBN 2753300917 [http://www.example.com example.com]
+!! result
+<p><abbr>(fr)</abbr> <a href="/wiki/Special:BookSources/2753300917" class="internal mw-magiclink-isbn">ISBN 2753300917</a> <a href="http://www.example.com" class="external text" rel="nofollow">example.com</a>
+</p>
+!! end
+
!! test
Double RFC
!! input