}
}
+ # Replace & from obsolete syntax with &.
+ # All HTML entities will be escaped by makeExternalLink()
+ # or maybeMakeImageLink()
+ $url = str_replace( '&', '&', $url );
+
# Process the trail (i.e. everything after this link up until start of the next link),
# replacing any non-bracketed links
$trail = $this->replaceFreeExternalLinks( $trail );
</p>
!! end
+!! test
+External links: encoded ampersand
+!! input
+Old & use: http://x&y
+!! result
+<p>Old & use: <a href="http://x&y" class='external free' rel="nofollow">http://x&y</a>
+</p>
+!! end
+
+!! test
+External links: [raw ampersand]
+!! input
+Old & use: [http://x&y]
+!! result
+<p>Old & use: <a href="http://x&y" class='external autonumber' title="http://x&y" rel="nofollow">[1]</a>
+</p>
+!! end
+
+!! test
+External links: [encoded ampersand]
+!! input
+Old & use: [http://x&y]
+!! result
+<p>Old & use: <a href="http://x&y" class='external autonumber' title="http://x&y" rel="nofollow">[1]</a>
+</p>
+!! end
+
!! test
External links: www.jpeg.org (bug 554)
!! input