1 ### This file has tests for external and url links
3 # The parsoid-compatible option below is only relevant when we are running
4 # parser tests in integrated mode with Parsoid. This option is ignored
5 # when this test file is run with Parsoid in standalone mode.
7 parsoid-compatible=wt2html,wt2wt
20 Dummy article to suppress redlinks in tests
26 Dummy article to suppress redlinks in tests
30 External links: non-bracketed
32 Non-bracketed: http://example.com
34 <p>Non-bracketed: <a rel="nofollow" class="external free" href="http://example.com">http://example.com</a>
38 # parsoid doesn't explicitly mark autonumbered links, see T55505
40 External links: numbered
42 Numbered: [http://example.com]
43 Numbered: [http://example.net]
44 Numbered: [http://example.com]
46 <p>Numbered: <a rel="nofollow" class="external autonumber" href="http://example.com">[1]</a>
47 Numbered: <a rel="nofollow" class="external autonumber" href="http://example.net">[2]</a>
48 Numbered: <a rel="nofollow" class="external autonumber" href="http://example.com">[3]</a>
51 <p>Numbered: <a rel="mw:ExtLink" href="http://example.com" class="external autonumber"></a>
52 Numbered: <a rel="mw:ExtLink" href="http://example.net" class="external autonumber"></a>
53 Numbered: <a rel="mw:ExtLink" href="http://example.com" class="external autonumber"></a></p>
57 External links: specified text
59 Specified text: [http://example.com link]
61 <p>Specified text: <a rel="nofollow" class="external text" href="http://example.com">link</a>
68 Linktrails should not work for external links: [http://example.com link]s
70 <p>Linktrails should not work for external links: <a rel="nofollow" class="external text" href="http://example.com">link</a>s
75 External links: dollar sign in URL
77 http://example.com/1$2345
79 <p><a rel="nofollow" class="external free" href="http://example.com/1$2345">http://example.com/1$2345</a>
83 # parsoid doesn't explicitly mark autonumbered links, see T55505
85 External links: dollar sign in URL (autonumber)
87 [http://example.com/1$2345]
89 <p><a rel="nofollow" class="external autonumber" href="http://example.com/1$2345">[1]</a>
92 <p><a rel="mw:ExtLink" href="http://example.com/1$2345" class="external autonumber"></a></p>
96 External links: open square bracket forbidden in URL (T6377)
98 parsoid=wt2html,wt2wt,html2html
100 http://example.com/1[2345
102 <p><a rel="nofollow" class="external free" href="http://example.com/1">http://example.com/1</a>[2345
105 <p><a rel="mw:ExtLink" href="http://example.com/1" class="external free">http://example.com/1</a>[2345</p>
109 External links: open square bracket forbidden in URL (named) (T6377)
111 parsoid=wt2html,html2html
113 [http://example.com/1[2345]
115 <p><a rel="nofollow" class="external text" href="http://example.com/1">[2345</a>
118 <p><a rel="mw:ExtLink" href="http://example.com/1" class="external text">[2345</a></p>
121 # parsoid adds a space before the link name
123 External links: open square bracket forbidden in URL (named) (T6377)
126 [http://example.com/1 [2345]
128 <p><a rel="nofollow" class="external text" href="http://example.com/1">[2345</a>
133 External links: nowiki in URL link text (T8230)
135 [http://example.com/ <nowiki>''example site''</nowiki>]
137 <p><a rel="nofollow" class="external text" href="http://example.com/">''example site''</a>
142 External links: newline forbidden in text (T8230 regression check)
144 [http://example.com/ first
147 <p>[<a rel="nofollow" class="external free" href="http://example.com/">http://example.com/</a> first
153 External links: Pipe char between url and text
155 [http://example.com | link]
157 <p><a rel="nofollow" class="external text" href="http://example.com">| link</a>
162 External links: protocol-relative URL in brackets
164 [//example.com/ Test]
166 <p><a rel="nofollow" class="external text" href="//example.com/">Test</a>
170 # parsoid doesn't explicitly mark autonumbered links, see T55505
172 External links: protocol-relative URL in brackets without text
176 <p><a rel="nofollow" class="external autonumber" href="//example.com">[1]</a>
179 <p><a rel="mw:ExtLink" href="//example.com" class="external autonumber"></a></p>
183 External links: protocol-relative URL in free text is left alone
192 External links: protocol-relative URL in the middle of a word is left alone (T32269)
196 <p>foo//example.com/Foo
200 ## html2wt and html2html will fail because we will prefer the :en: interwiki prefix over wikipedia:
202 External links: with no contents
204 parsoid=wt2html,wt2wt
206 [http://en.wikipedia.org/wiki/Foo]
208 [[wikipedia:Foo|Bar]]
210 [[wikipedia:Foo|<span>Bar</span>]]
212 <p><a rel="nofollow" class="external autonumber" href="http://en.wikipedia.org/wiki/Foo">[1]</a>
213 </p><p><a href="http://en.wikipedia.org/wiki/Foo" class="extiw" title="wikipedia:Foo">Bar</a>
214 </p><p><a href="http://en.wikipedia.org/wiki/Foo" class="extiw" title="wikipedia:Foo"><span>Bar</span></a>
217 <p><a rel="mw:ExtLink" href="http://en.wikipedia.org/wiki/Foo" class="external autonumber"></a></p>
218 <p><a rel="mw:WikiLink/Interwiki" href="http://en.wikipedia.org/wiki/Foo" title="wikipedia:Foo" class="extiw">Bar</a></p>
219 <p><a rel="mw:WikiLink/Interwiki" href="http://en.wikipedia.org/wiki/Foo" title="wikipedia:Foo" class="extiw"><span>Bar</span></a></p>
223 External links: Free with trailing punctuation
233 http://example.com/url_with_(brackets)
234 (http://example.com/url_without_brackets)
235 http://example.com/url_with_entity&
236 http://example.com/url_with_entity&
237 http://example.com/url_with_entity&
238 http://example.com/url_with_entity
239 http://example.com/url_with_entity 
240 http://example.com/url_with_entity 
241 http://example.com/url_with_entity<
242 http://example.com/url_with_entity<
243 http://example.com/url_with_entity<
245 <p><a rel="nofollow" class="external free" href="http://example.com">http://example.com</a>,
246 <a rel="nofollow" class="external free" href="http://example.com">http://example.com</a>;
247 <a rel="nofollow" class="external free" href="http://example.com">http://example.com</a>\
248 <a rel="nofollow" class="external free" href="http://example.com">http://example.com</a>.
249 <a rel="nofollow" class="external free" href="http://example.com">http://example.com</a>:
250 <a rel="nofollow" class="external free" href="http://example.com">http://example.com</a>!
251 <a rel="nofollow" class="external free" href="http://example.com">http://example.com</a>?
252 <a rel="nofollow" class="external free" href="http://example.com">http://example.com</a>)
253 <a rel="nofollow" class="external free" href="http://example.com/url_with_(brackets)">http://example.com/url_with_(brackets)</a>
254 (<a rel="nofollow" class="external free" href="http://example.com/url_without_brackets">http://example.com/url_without_brackets</a>)
255 <a rel="nofollow" class="external free" href="http://example.com/url_with_entity&">http://example.com/url_with_entity&</a>
256 <a rel="nofollow" class="external free" href="http://example.com/url_with_entity&">http://example.com/url_with_entity&</a>
257 <a rel="nofollow" class="external free" href="http://example.com/url_with_entity&">http://example.com/url_with_entity&</a>
258 <a rel="nofollow" class="external free" href="http://example.com/url_with_entity">http://example.com/url_with_entity</a> 
259 <a rel="nofollow" class="external free" href="http://example.com/url_with_entity">http://example.com/url_with_entity</a> 
260 <a rel="nofollow" class="external free" href="http://example.com/url_with_entity">http://example.com/url_with_entity</a> 
261 <a rel="nofollow" class="external free" href="http://example.com/url_with_entity">http://example.com/url_with_entity</a><
262 <a rel="nofollow" class="external free" href="http://example.com/url_with_entity">http://example.com/url_with_entity</a><
263 <a rel="nofollow" class="external free" href="http://example.com/url_with_entity">http://example.com/url_with_entity</a><
266 <p><a rel="mw:ExtLink" href="http://example.com" class="external free" data-parsoid='{"stx":"url"}'>http://example.com</a>,
267 <a rel="mw:ExtLink" href="http://example.com" class="external free" data-parsoid='{"stx":"url"}'>http://example.com</a>;
268 <a rel="mw:ExtLink" href="http://example.com" class="external free" data-parsoid='{"stx":"url"}'>http://example.com</a>\
269 <a rel="mw:ExtLink" href="http://example.com" class="external free" data-parsoid='{"stx":"url"}'>http://example.com</a>.
270 <a rel="mw:ExtLink" href="http://example.com" class="external free" data-parsoid='{"stx":"url"}'>http://example.com</a>:
271 <a rel="mw:ExtLink" href="http://example.com" class="external free" data-parsoid='{"stx":"url"}'>http://example.com</a>!
272 <a rel="mw:ExtLink" href="http://example.com" class="external free" data-parsoid='{"stx":"url"}'>http://example.com</a>?
273 <a rel="mw:ExtLink" href="http://example.com" class="external free" data-parsoid='{"stx":"url"}'>http://example.com</a>)
274 <a rel="mw:ExtLink" href="http://example.com/url_with_(brackets)" class="external free" data-parsoid='{"stx":"url"}'>http://example.com/url_with_(brackets)</a>
275 (<a rel="mw:ExtLink" href="http://example.com/url_without_brackets" class="external free" data-parsoid='{"stx":"url"}'>http://example.com/url_without_brackets</a>)
276 <a rel="mw:ExtLink" href="http://example.com/url_with_entity&" class="external free" data-parsoid='{"stx":"url","a":{"href":"http://example.com/url_with_entity&"},"sa":{"href":"http://example.com/url_with_entity&amp;"}}'>http://example.com/url_with_entity&</a>
277 <a rel="mw:ExtLink" href="http://example.com/url_with_entity&" class="external free" data-parsoid='{"stx":"url","a":{"href":"http://example.com/url_with_entity&"},"sa":{"href":"http://example.com/url_with_entity&#x26;"}}'>http://example.com/url_with_entity&</a>
278 <a rel="mw:ExtLink" href="http://example.com/url_with_entity&" class="external free" data-parsoid='{"stx":"url","a":{"href":"http://example.com/url_with_entity&"},"sa":{"href":"http://example.com/url_with_entity&#038;"}}'>http://example.com/url_with_entity&</a>
279 <a rel="mw:ExtLink" href="http://example.com/url_with_entity" class="external free" data-parsoid='{"stx":"url"}'>http://example.com/url_with_entity</a><span typeof="mw:Entity" data-parsoid='{"src":"&nbsp;","srcContent":" "}'> </span>
280 <a rel="mw:ExtLink" href="http://example.com/url_with_entity" class="external free" data-parsoid='{"stx":"url"}'>http://example.com/url_with_entity</a><span typeof="mw:Entity" data-parsoid='{"src":"&#xA0;","srcContent":" "}'> </span>
281 <a rel="mw:ExtLink" href="http://example.com/url_with_entity" class="external free" data-parsoid='{"stx":"url"}'>http://example.com/url_with_entity</a><span typeof="mw:Entity" data-parsoid='{"src":"&#160;","srcContent":" "}'> </span>
282 <a rel="mw:ExtLink" href="http://example.com/url_with_entity" class="external free" data-parsoid='{"stx":"url"}'>http://example.com/url_with_entity</a><span typeof="mw:Entity" data-parsoid='{"src":"&lt;","srcContent":"<"}'><</span>
283 <a rel="mw:ExtLink" href="http://example.com/url_with_entity" class="external free" data-parsoid='{"stx":"url"}'>http://example.com/url_with_entity</a><span typeof="mw:Entity" data-parsoid='{"src":"&#x3C;","srcContent":"<"}'><</span>
284 <a rel="mw:ExtLink" href="http://example.com/url_with_entity" class="external free" data-parsoid='{"stx":"url"}'>http://example.com/url_with_entity</a><span typeof="mw:Entity" data-parsoid='{"src":"&#60;","srcContent":"<"}'><</span></p>
288 External links: tricky Parsoid html2html case
290 parsoid=wt2html,wt2wt,html2html
292 http://example.com/url_with_entity&amp;
294 <p><a rel="nofollow" class="external free" href="http://example.com/url_with_entity&amp">http://example.com/url_with_entity&amp</a>;
297 <p><a rel="mw:ExtLink" href="http://example.com/url_with_entity&amp" class="external free">http://example.com/url_with_entity&amp</a>;</p>
301 External links: html2html with trailing dot (T263203)
303 test [http://example.com/test. http://example.com/test.] test
305 test http://example.com/test. test
307 <p>test <a rel="mw:ExtLink" href="http://example.com/test." class="external text">http://example.com/test.</a> test</p>
309 <p>test <a rel="mw:ExtLink" href="http://example.com/test" class="external free" data-parsoid='{"stx":"url"}'>http://example.com/test</a>. test</p>
311 <p>test <a rel="nofollow" class="external text" href="http://example.com/test.">http://example.com/test.</a> test
312 </p><p>test <a rel="nofollow" class="external free" href="http://example.com/test">http://example.com/test</a>. test
317 External links: Free with trailing quotes (T113666)
319 '''News:''' Stuff here
323 <p><b>News:</b> Stuff here
324 </p><p><a rel="nofollow" class="external free" href="news:'a'b">news:'a'b</a><i>c</i>d e
327 <p><b>News:</b> Stuff here</p>
328 <p><a rel="mw:ExtLink" href="news:'a'b" class="external free">news:'a'b</a><i>c</i>d e</p>
332 External links: with entity
334 [http:// www.librarieswithoutborders.org Libraries without borders]
336 <p><a rel="nofollow" class="external text" href="http://+www.librarieswithoutborders.org">Libraries without borders</a>
339 <p><a rel="mw:ExtLink" href="http://+www.librarieswithoutborders.org" class="external text" data-parsoid='{"a":{"href":"http://+www.librarieswithoutborders.org"},"sa":{"href":"http://&#x20;www.librarieswithoutborders.org"}}'>Libraries without borders</a></p>
343 External links: Lone protocols are never linked (T105697)
362 External links: No preceding word characters allowed (T67278)
364 NOPEhttp://example.com
366 ok:http://example.com
367 ok-http://example.com
369 <p>NOPEhttp://example.com
371 ok:<a rel="nofollow" class="external free" href="http://example.com">http://example.com</a>
372 ok-<a rel="nofollow" class="external free" href="http://example.com">http://example.com</a>
377 External links: nofollow domain exception
379 A [https://no-nofollow.org/foobar link], and another [https://example.org link].
381 <p>A <a class="external text" href="https://no-nofollow.org/foobar">link</a>, and another <a rel="nofollow" class="external text" href="https://example.org">link</a>.
388 External image: http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png
390 <p>External image: <img src="http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png" alt="Ncwikicol.png" />
395 External image from https
397 External image from https: https://meta.wikimedia.org/upload/f/f1/Ncwikicol.png
399 <p>External image from https: <img src="https://meta.wikimedia.org/upload/f/f1/Ncwikicol.png" alt="Ncwikicol.png" />
404 External image (when not allowed)
406 wgAllowExternalImages=0
408 External image: http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png
410 <p>External image: <a rel="nofollow" class="external free" href="http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png">http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png</a>
413 <p>External image: <a rel="mw:ExtLink" href="http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png" class="external free" data-parsoid='{"stx":"url"}'>http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png</a></p>
414 !! html/parsoid+integrated
415 <p>External image: <a rel="mw:ExtLink nofollow" href="http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png" class="external free" data-parsoid='{"stx":"url"}'>http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png</a></p>
419 Link to non-http image, no img tag
421 Link to non-http image, no img tag: ftp://example.com/test.jpg
423 <p>Link to non-http image, no img tag: <a rel="nofollow" class="external free" href="ftp://example.com/test.jpg">ftp://example.com/test.jpg</a>
428 External links: terminating separator
430 Terminating separator: http://example.com/thing,
432 <p>Terminating separator: <a rel="nofollow" class="external free" href="http://example.com/thing">http://example.com/thing</a>,
437 External links: intervening separator
439 Intervening separator: http://example.com/1,2,3
441 <p>Intervening separator: <a rel="nofollow" class="external free" href="http://example.com/1,2,3">http://example.com/1,2,3</a>
446 External links: old bug with URL in query
448 Old bug with URL in query: [http://example.com/thing?url=http://example.com link]
450 <p>Old bug with URL in query: <a rel="nofollow" class="external text" href="http://example.com/thing?url=http://example.com">link</a>
455 External links: old URL-in-URL bug, mixed protocols
457 And again with mixed protocols: [ftp://example.com?url=http://example.com link]
459 <p>And again with mixed protocols: <a rel="nofollow" class="external text" href="ftp://example.com?url=http://example.com">link</a>
463 # Since Parsoid is starting to emit canonical wikitext for links,
464 # [http://example.com http://example.com] will not RT back to that
467 External links: URL in text
471 URL in text: [http://example.com http://example.com]
473 <p>URL in text: <a rel="nofollow" class="external text" href="http://example.com">http://example.com</a>
476 <p>URL in text: <a rel="mw:ExtLink" href="http://example.com" class="external text">http://example.com</a></p>
480 External links: Clickable images
482 ja-style clickable images: [http://example.com http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png]
484 <p>ja-style clickable images: <a rel="nofollow" class="external text" href="http://example.com"><img src="http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png" alt="Ncwikicol.png" /></a>
487 <p>ja-style clickable images: <a rel="mw:ExtLink" href="http://example.com" class="external text"><img src="http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png" alt="Ncwikicol.png" data-parsoid='{"type":"extlink"}'/></a></p>
491 External links: raw ampersand
493 Old & use: http://x&y
495 <p>Old & use: <a rel="nofollow" class="external free" href="http://x&y">http://x&y</a>
500 External links: encoded ampersand
502 Old & use: http://x&y
504 <p>Old & use: <a rel="nofollow" class="external free" href="http://x&y">http://x&y</a>
507 <p>Old <span typeof="mw:Entity">&</span> use: <a rel="mw:ExtLink" href="http://x&y" class="external free">http://x&y</a></p>
511 External links: encoded equals (T8102)
513 http://example.com/?foo=bar
515 <p><a rel="nofollow" class="external free" href="http://example.com/?foo=bar">http://example.com/?foo=bar</a>
518 <p><a rel="mw:ExtLink" href="http://example.com/?foo=bar" class="external free">http://example.com/?foo=bar</a></p>
522 ## Note that parsoid doesn't explicit mark autonumbered links, nor
523 ## does it number them. As discussed in T55505, we can identify
524 ## autonumbered links via CSS.
528 External links: [raw ampersand]
530 Old & use: [http://x&y]
532 <p>Old & use: <a rel="nofollow" class="external autonumber" href="http://x&y">[1]</a>
535 <p>Old <span typeof="mw:Entity">&</span> use: <a rel="mw:ExtLink" href="http://x&y" class="external autonumber"></a></p>
538 # note that parsoid html is identical to [raw ampersand] case; so html2wt
539 # mode will return the [raw ampersand] wikitext
541 External links: [encoded ampersand]
543 parsoid=wt2html,wt2wt,html2html
545 Old & use: [http://x&y]
547 <p>Old & use: <a rel="nofollow" class="external autonumber" href="http://x&y">[1]</a>
550 <p>Old <span typeof="mw:Entity">&</span> use: <a rel="mw:ExtLink" href="http://x&y" class="external autonumber"></a></p>
554 External links: [raw equals]
556 [http://example.com/?foo=bar]
558 <p><a rel="nofollow" class="external autonumber" href="http://example.com/?foo=bar">[1]</a>
561 <p><a rel="mw:ExtLink" href="http://example.com/?foo=bar" class="external autonumber"></a></p>
564 # note that parsoid html is identical to [raw equals] case; so html2wt
565 # mode will return the [raw equals] wikitext
567 External links: [encoded equals] (T8102)
569 parsoid=wt2html,wt2wt,html2html
571 [http://example.com/?foo=bar]
573 <p><a rel="nofollow" class="external autonumber" href="http://example.com/?foo=bar">[1]</a>
576 <p><a rel="mw:ExtLink" href="http://example.com/?foo=bar" class="external autonumber"></a></p>
579 # xxx parsoid strips the IDN character, so the round-trip tests will
580 # obviously fail and are disabled. --cscott
582 External links: [IDN ignored character reference in hostname; strip it right off]
584 parsoid=wt2html,wt2wt,html2html
586 [http://e‌xample.com/]
588 <p><a rel="nofollow" class="external autonumber" href="http://example.com/">[1]</a>
591 <p><a rel="mw:ExtLink" href="http://example.com/" class="external autonumber"></a></p>
594 # FIXME: This test (the IDN characters in the text of a link) is an inconsistency.
595 # Where an external link could easily circumvent the sanitization of the text of
596 # a link like this (where an IDN-ignore character is in the URL somewhere), this
597 # test demands a higher standard. That's a bit strange.
601 # http://example.com -> [http://example.com|http://example.com]
602 # [http://example.com|http://example.com] -> [http://example.com|http://example.com]
604 # The first example is sanitized, but the second is not. Any security benefits
605 # from this production are trivial to circumvent. Either remove this test and
606 # let the parser(s) do their thing unaccosted, or fix the inconsistency and change
607 # the test accordingly.
611 # xxx parsoid strips the IDN character, so the round-trip tests will
612 # obviously fail and are disabled. --cscott
614 External links: IDN ignored character reference in hostname; strip it right off
616 parsoid=wt2html,html2html
618 http://e‌xample.com/
620 <p><a rel="nofollow" class="external free" href="http://example.com/">http://example.com/</a>
623 <p><a rel="mw:ExtLink" href="http://example.com/" class="external free">http://example.com/</a></p>
627 External links: www.jpeg.org (T2554)
631 <p><a rel="nofollow" class="external free" href="http://www.jpeg.org">http://www.jpeg.org</a>
635 # parsoid doesn't explicitly mark autonumbered links, see T55505
637 External links: URL within URL (T2002)
639 [http://www.unausa.org/newindex.asp?place=http://www.unausa.org/programs/mun.asp]
641 <p><a rel="nofollow" class="external autonumber" href="http://www.unausa.org/newindex.asp?place=http://www.unausa.org/programs/mun.asp">[1]</a>
644 <p><a rel="mw:ExtLink" href="http://www.unausa.org/newindex.asp?place=http://www.unausa.org/programs/mun.asp" class="external autonumber"></a></p>
648 T2361: URL inside bracketed URL
650 [http://www.example.com/foo http://www.example.com/bar]
652 <p><a rel="nofollow" class="external text" href="http://www.example.com/foo">http://www.example.com/bar</a>
657 T2361: URL within URL, not bracketed
659 http://www.example.com/foo?=http://www.example.com/bar
661 <p><a rel="nofollow" class="external free" href="http://www.example.com/foo?=http://www.example.com/bar">http://www.example.com/foo?=http://www.example.com/bar</a>
666 T2289: ">"-token in URL-tail
668 http://www.example.com/<hello>
670 <p><a rel="nofollow" class="external free" href="http://www.example.com/">http://www.example.com/</a><hello>
675 T2289: literal ">"-token in URL-tail
677 http://www.example.com/<b>html</b>
679 <p><a rel="nofollow" class="external free" href="http://www.example.com/">http://www.example.com/</a><b>html</b>
682 <p><a rel="mw:ExtLink" href="http://www.example.com/" class="external free" data-parsoid='{"stx":"url"}'>http://www.example.com/</a><b data-parsoid='{"stx":"html"}'>html</b></p>
686 T2289: ">"-token in bracketed URL
688 [http://www.example.com/<hello> stuff]
690 <p><a rel="nofollow" class="external text" href="http://www.example.com/"><hello> stuff</a>
695 T2289: literal ">"-token in bracketed URL
697 [http://www.example.com/<b>html</b> stuff]
699 <p><a rel="nofollow" class="external text" href="http://www.example.com/"><b>html</b> stuff</a>
704 T2289: literal double quote at end of URL
706 http://www.example.com/"hello"
708 <p><a rel="nofollow" class="external free" href="http://www.example.com/">http://www.example.com/</a>"hello"
713 T2289: literal double quote in bracketed URL
715 [http://www.example.com/"hello" stuff]
717 <p><a rel="nofollow" class="external text" href="http://www.example.com/">"hello" stuff</a>
722 External links: multiple legal whitespace is fine, Magnus. Don't break it please. (T7081)
724 [http://www.example.com test]
726 <p><a rel="nofollow" class="external text" href="http://www.example.com">test</a>
731 External links: link text with spaces
733 [http://www.example.com a b c]
734 [http://www.example.com ''a'' ''b'']
736 <p><a rel="nofollow" class="external text" href="http://www.example.com">a b c</a>
737 <a rel="nofollow" class="external text" href="http://www.example.com"><i>a</i> <i>b</i></a>
741 # Note edge case difference between PHP and Parsoid here.
743 External links: wiki links within external link (T5695)
747 [http://example.com [[wikilink]] embedded in ext link]
749 [http://example.com test [[wikilink]] embedded in ext link]
751 <p><a rel="nofollow" class="external text" href="http://example.com"></a><a href="/wiki/Wikilink" title="Wikilink">wikilink</a> embedded in ext link
752 </p><p><a rel="nofollow" class="external text" href="http://example.com">test </a><a href="/wiki/Wikilink" title="Wikilink">wikilink</a> embedded in ext link
755 <p><a rel="mw:ExtLink nofollow" href="http://example.com" class="external autonumber"></a><a rel="mw:WikiLink" href="./Wikilink" title="Wikilink" data-parsoid='{"stx":"simple","a":{"href":"./Wikilink"},"sa":{"href":"wikilink"},"misnested":true}'>wikilink</a><span data-parsoid='{"misnested":true}'> embedded in ext link</span></p>
757 <p><a rel="mw:ExtLink nofollow" href="http://example.com" class="external text">test </a><a rel="mw:WikiLink" href="./Wikilink" title="Wikilink" data-parsoid='{"stx":"simple","a":{"href":"./Wikilink"},"sa":{"href":"wikilink"},"misnested":true}'>wikilink</a><span data-parsoid='{"misnested":true}'> embedded in ext link</span></p>
761 T2787: Links with one slash after the url protocol are invalid
765 [http:/example.com title]
768 </p><p>[http:/example.com title]
773 Bracketed external links with template-generated invalid target
775 [{{1x|http:/example.com}} title]
777 <p>[http:/example.com title]
784 http://www.example.com/?title=AT%26T
786 <p><a rel="nofollow" class="external free" href="http://www.example.com/?title=AT%26T">http://www.example.com/?title=AT%26T</a>
789 <p><a rel="mw:ExtLink" href="http://www.example.com/?title=AT%26T" class="external free">http://www.example.com/?title=AT%26T</a></p>
792 # According to https://www.w3.org/TR/2011/WD-html5-20110525/Overview.html#parsing-urls a plain
793 # % is actually legal in HTML5. Any change in output would need testing though.
795 T6781, T7267: %25 in URL
797 http://www.example.com/?title=100%25_Bran
799 <p><a rel="nofollow" class="external free" href="http://www.example.com/?title=100%25_Bran">http://www.example.com/?title=100%25_Bran</a>
802 <p><a rel="mw:ExtLink" href="http://www.example.com/?title=100%25_Bran" class="external free">http://www.example.com/?title=100%25_Bran</a></p>
806 T6781, T7267: %28, %29 in URL
808 http://www.example.com/?title=Ben-Hur_%281959_film%29
810 <p><a rel="nofollow" class="external free" href="http://www.example.com/?title=Ben-Hur_%281959_film%29">http://www.example.com/?title=Ben-Hur_%281959_film%29</a>
813 <p><a rel="mw:ExtLink" href="http://www.example.com/?title=Ben-Hur_%281959_film%29" class="external free">http://www.example.com/?title=Ben-Hur_%281959_film%29</a></p>
818 T6781: %26 in autonumber URL
820 [http://www.example.com/?title=AT%26T]
822 <p><a rel="nofollow" class="external autonumber" href="http://www.example.com/?title=AT%26T">[1]</a>
825 <p><a rel="mw:ExtLink" href="http://www.example.com/?title=AT%26T" class="external autonumber"></a></p>
829 T6781, T7267: %26 in autonumber URL
831 [http://www.example.com/?title=100%25_Bran]
833 <p><a rel="nofollow" class="external autonumber" href="http://www.example.com/?title=100%25_Bran">[1]</a>
836 <p><a rel="mw:ExtLink" href="http://www.example.com/?title=100%25_Bran" class="external autonumber"></a></p>
840 T6781, T7267: %28, %29 in autonumber URL
842 [http://www.example.com/?title=Ben-Hur_%281959_film%29]
844 <p><a rel="nofollow" class="external autonumber" href="http://www.example.com/?title=Ben-Hur_%281959_film%29">[1]</a>
847 <p><a rel="mw:ExtLink" href="http://www.example.com/?title=Ben-Hur_%281959_film%29" class="external autonumber"></a></p>
852 T6781: %26 in bracketed URL
854 [http://www.example.com/?title=AT%26T link]
856 <p><a rel="nofollow" class="external text" href="http://www.example.com/?title=AT%26T">link</a>
859 <p><a rel="mw:ExtLink" href="http://www.example.com/?title=AT%26T" class="external text">link</a></p>
863 T6781, T7267: %25 in bracketed URL
865 [http://www.example.com/?title=100%25_Bran link]
867 <p><a rel="nofollow" class="external text" href="http://www.example.com/?title=100%25_Bran">link</a>
872 T6781, T7267: %28, %29 in bracketed URL
874 [http://www.example.com/?title=Ben-Hur_%281959_film%29 link]
876 <p><a rel="nofollow" class="external text" href="http://www.example.com/?title=Ben-Hur_%281959_film%29">link</a>
879 <p><a rel="mw:ExtLink" href="http://www.example.com/?title=Ben-Hur_%281959_film%29" class="external text">link</a></p>
883 External link containing a period in the anchor. (T65947)
885 [//foo.org/bar#baz. bang]
887 [//foo.org/bar. bang]
889 <p><a rel="nofollow" class="external text" href="//foo.org/bar#baz.">bang</a>
890 </p><p><a rel="nofollow" class="external text" href="//foo.org/bar.">bang</a>
893 <p><a rel="mw:ExtLink" href="//foo.org/bar#baz." class="external text">bang</a></p>
894 <p><a rel="mw:ExtLink" href="//foo.org/bar." class="external text">bang</a></p>
898 External link containing a single quote. (T65947)
902 [//foo.org/bar'baz bang]
904 <p><a rel="nofollow" class="external autonumber" href="//foo.org/bar'baz">[1]</a>
905 </p><p><a rel="nofollow" class="external text" href="//foo.org/bar'baz">bang</a>
908 <p><a rel="mw:ExtLink" href="//foo.org/bar'baz" class="external autonumber"></a></p>
909 <p><a rel="mw:ExtLink" href="//foo.org/bar'baz" class="external text">bang</a></p>
913 External link containing double-single-quotes in text '' (T6598 check)
915 Some [http://example.com/ pretty ''italics'' and stuff]!
917 <p>Some <a rel="nofollow" class="external text" href="http://example.com/">pretty <i>italics</i> and stuff</a>!
921 # Note different rendering by Parsoid here compared to the legacy parser.
923 External link containing double-single-quotes in text embedded in italics (T6598 check)
925 ''Some [http://example.com/ pretty ''italics'' and stuff]!''
927 <p><i>Some <a rel="nofollow" class="external text" href="http://example.com/">pretty </a></i><a rel="nofollow" class="external text" href="http://example.com/">italics<i> and stuff</i></a><i>!</i>
930 <p><i>Some <a rel="mw:ExtLink" href="http://example.com/" class="external text">pretty <i>italics</i> and stuff</a>!</i></p>
933 # Don't add the html/php section since the output is broken and there isn't any reason to spec it
935 External link containing double-single-quotes with no space separating the url from text in italics
937 [http://www.musee-picasso.fr/pages/page_id18528_u1l2.htm''La muerte de Casagemas'' (1901) en el sitio de [[Museo Picasso (París)|Museo Picasso]].]
939 <p><a rel="nofollow" class="external text" href="http://www.musee-picasso.fr/pages/page_id18528_u1l2.htm"><i>La muerte de Casagemas</i> (1901) en el sitio de </a><a href="/wiki/Museo_Picasso_(Par%C3%ADs)" title="Museo Picasso (París)">Museo Picasso</a>.
942 <p><a rel="mw:ExtLink nofollow" href="http://www.musee-picasso.fr/pages/page_id18528_u1l2.htm" class="external text"><i>La muerte de Casagemas</i> (1901) en el sitio de </a><a rel="mw:WikiLink" href="./Museo_Picasso_(París)" title="Museo Picasso (París)" data-parsoid='{"stx":"piped","a":{"href":"./Museo_Picasso_(París)"},"sa":{"href":"Museo Picasso (París)"},"misnested":true}' >Museo Picasso</a><span data-parsoid='{"misnested":true}'>.</span></p>
946 External link with comments in link text
948 [http://www.google.com Google <!-- comment -->]
950 <p><a rel="nofollow" class="external text" href="http://www.google.com">Google </a>
953 <p><a rel="mw:ExtLink" href="http://www.google.com" class="external text">Google <!-- comment --></a></p>
957 External link to bare IPv4 address
959 [http://192.168.0.1 Link]
961 <p><a rel="nofollow" class="external text" href="http://192.168.0.1">Link</a>
964 <p><a rel="mw:ExtLink" href="http://192.168.0.1" class="external text">Link</a></p>
968 URL-encoding in URL functions (single parameter)
970 {{localurl:Some page|amp=&}}
972 <p>/index.php?title=Some_page&amp=&
977 URL-encoding in URL functions (multiple parameters)
979 {{localurl:Some page|q=?&=&}}
981 <p>/index.php?title=Some_page&q=?&amp=&
988 http://example.com/index.php?foozoid%5B%5D=bar
990 http://example.com/index.php?foozoid[]=bar
992 <p><a rel="nofollow" class="external free" href="http://example.com/index.php?foozoid%5B%5D=bar">http://example.com/index.php?foozoid%5B%5D=bar</a>
993 </p><p><a rel="nofollow" class="external free" href="http://example.com/index.php?foozoid%5B%5D=bar">http://example.com/index.php?foozoid%5B%5D=bar</a>
996 <p><a rel="mw:ExtLink" href="http://example.com/index.php?foozoid%5B%5D=bar" class="external free">http://example.com/index.php?foozoid%5B%5D=bar</a></p>
998 <p><a rel="mw:ExtLink" href="http://example.com/index.php?foozoid%5B%5D=bar" class="external free" data-parsoid='{"stx":"url","a":{"href":"http://example.com/index.php?foozoid%5B%5D=bar"},"sa":{"href":"http://example.com/index.php?foozoid&#x5B;&#x5D;=bar"}}'>http://example.com/index.php?foozoid%5B%5D=bar</a></p>
1002 IPv6 urls, autolink format (T23261)
1004 http://[2404:130:0:1000::187:2]/index.php
1006 Examples from RFC 2373, section 2.2:
1008 *http://[1080::8:800:200C:417A]/unicast
1009 *http://[FF01::101]/multicast
1010 *http://[::1]/loopback
1011 *http://[::]/unspecified
1012 *http://[::13.1.68.3]/ipv4compat
1013 *http://[::FFFF:129.144.52.38]/ipv4compat
1015 Examples from RFC 2732, section 2:
1017 *http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]:80/index.html
1018 *http://[1080:0:0:0:8:800:200C:417A]/index.html
1019 *http://[3ffe:2a00:100:7031::1]
1020 *http://[1080::8:800:200C:417A]/foo
1021 *http://[::192.9.5.5]/ipng
1022 *http://[::FFFF:129.144.52.38]:80/index.html
1023 *http://[2010:836B:4179::836B:4179]
1025 <p><a rel="nofollow" class="external free" href="http://[2404:130:0:1000::187:2]/index.php">http://[2404:130:0:1000::187:2]/index.php</a>
1026 </p><p>Examples from <a class="external mw-magiclink-rfc" rel="nofollow" href="https://tools.ietf.org/html/rfc2373">RFC 2373</a>, section 2.2:
1028 <ul><li><a rel="nofollow" class="external free" href="http://[1080::8:800:200C:417A]/unicast">http://[1080::8:800:200C:417A]/unicast</a></li>
1029 <li><a rel="nofollow" class="external free" href="http://[FF01::101]/multicast">http://[FF01::101]/multicast</a></li>
1030 <li><a rel="nofollow" class="external free" href="http://[::1]/loopback">http://[::1]/loopback</a></li>
1031 <li><a rel="nofollow" class="external free" href="http://[::]/unspecified">http://[::]/unspecified</a></li>
1032 <li><a rel="nofollow" class="external free" href="http://[::13.1.68.3]/ipv4compat">http://[::13.1.68.3]/ipv4compat</a></li>
1033 <li><a rel="nofollow" class="external free" href="http://[::FFFF:129.144.52.38]/ipv4compat">http://[::FFFF:129.144.52.38]/ipv4compat</a></li></ul>
1034 <p>Examples from <a class="external mw-magiclink-rfc" rel="nofollow" href="https://tools.ietf.org/html/rfc2732">RFC 2732</a>, section 2:
1036 <ul><li><a rel="nofollow" class="external free" href="http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]:80/index.html">http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]:80/index.html</a></li>
1037 <li><a rel="nofollow" class="external free" href="http://[1080:0:0:0:8:800:200C:417A]/index.html">http://[1080:0:0:0:8:800:200C:417A]/index.html</a></li>
1038 <li><a rel="nofollow" class="external free" href="http://[3ffe:2a00:100:7031::1]">http://[3ffe:2a00:100:7031::1]</a></li>
1039 <li><a rel="nofollow" class="external free" href="http://[1080::8:800:200C:417A]/foo">http://[1080::8:800:200C:417A]/foo</a></li>
1040 <li><a rel="nofollow" class="external free" href="http://[::192.9.5.5]/ipng">http://[::192.9.5.5]/ipng</a></li>
1041 <li><a rel="nofollow" class="external free" href="http://[::FFFF:129.144.52.38]:80/index.html">http://[::FFFF:129.144.52.38]:80/index.html</a></li>
1042 <li><a rel="nofollow" class="external free" href="http://[2010:836B:4179::836B:4179]">http://[2010:836B:4179::836B:4179]</a></li></ul>
1044 <p><a rel="mw:ExtLink" href="http://[2404:130:0:1000::187:2]/index.php" class="external free">http://[2404:130:0:1000::187:2]/index.php</a></p>
1046 <p>Examples from <a href="https://tools.ietf.org/html/rfc2373" rel="mw:ExtLink" class="external mw-magiclink">RFC 2373</a>, section 2.2:</p>
1047 <ul><li><a rel="mw:ExtLink" href="http://[1080::8:800:200C:417A]/unicast" class="external free">http://[1080::8:800:200C:417A]/unicast</a></li>
1048 <li><a rel="mw:ExtLink" href="http://[FF01::101]/multicast" class="external free">http://[FF01::101]/multicast</a></li>
1049 <li><a rel="mw:ExtLink" href="http://[::1]/loopback" class="external free">http://[::1]/loopback</a></li>
1050 <li><a rel="mw:ExtLink" href="http://[::]/unspecified" class="external free">http://[::]/unspecified</a></li>
1051 <li><a rel="mw:ExtLink" href="http://[::13.1.68.3]/ipv4compat" class="external free">http://[::13.1.68.3]/ipv4compat</a></li>
1052 <li><a rel="mw:ExtLink" href="http://[::FFFF:129.144.52.38]/ipv4compat" class="external free">http://[::FFFF:129.144.52.38]/ipv4compat</a></li></ul>
1054 <p>Examples from <a href="https://tools.ietf.org/html/rfc2732" rel="mw:ExtLink" class="external mw-magiclink">RFC 2732</a>, section 2:</p>
1055 <ul><li><a rel="mw:ExtLink" href="http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]:80/index.html" class="external free">http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]:80/index.html</a></li>
1056 <li><a rel="mw:ExtLink" href="http://[1080:0:0:0:8:800:200C:417A]/index.html" class="external free">http://[1080:0:0:0:8:800:200C:417A]/index.html</a></li>
1057 <li><a rel="mw:ExtLink" href="http://[3ffe:2a00:100:7031::1]" class="external free">http://[3ffe:2a00:100:7031::1]</a></li>
1058 <li><a rel="mw:ExtLink" href="http://[1080::8:800:200C:417A]/foo" class="external free">http://[1080::8:800:200C:417A]/foo</a></li>
1059 <li><a rel="mw:ExtLink" href="http://[::192.9.5.5]/ipng" class="external free">http://[::192.9.5.5]/ipng</a></li>
1060 <li><a rel="mw:ExtLink" href="http://[::FFFF:129.144.52.38]:80/index.html" class="external free">http://[::FFFF:129.144.52.38]:80/index.html</a></li>
1061 <li><a rel="mw:ExtLink" href="http://[2010:836B:4179::836B:4179]" class="external free">http://[2010:836B:4179::836B:4179]</a></li></ul>
1064 # It might make sense to change this behavior; see
1065 # See https://phabricator.wikimedia.org/T238022#5665580
1067 Unicode text around autolinks
1071 größ https://foo.org
1073 아들 고건 사진https://foo.org
1077 <p>größhttps://foo.org
1078 </p><p>größ <a rel="nofollow" class="external free" href="https://foo.org">https://foo.org</a>
1079 </p><p>아들 고건 사진https://foo.org
1080 </p><p>💩<a rel="nofollow" class="external free" href="https://foo.org">https://foo.org</a>
1083 <p>größhttps://foo.org</p>
1085 <p>größ <a rel="mw:ExtLink" href="https://foo.org" class="external free" data-parsoid='{"stx":"url"}'>https://foo.org</a></p>
1087 <p>아들 고건 사진https://foo.org</p>
1089 <p>💩<a rel="mw:ExtLink" href="https://foo.org" class="external free" data-parsoid='{"stx":"url"}'>https://foo.org</a></p>
1093 IPv6 urls, bracketed format (T23261)
1095 [http://[2404:130:0:1000::187:2]/index.php test]
1097 Examples from RFC 2373, section 2.2:
1099 *[http://[1080::8:800:200C:417A] unicast]
1100 *[http://[FF01::101] multicast]
1101 *[http://[::1]/ loopback]
1102 *[http://[::] unspecified]
1103 *[http://[::13.1.68.3] ipv4compat]
1104 *[http://[::FFFF:129.144.52.38] ipv4compat]
1106 Examples from RFC 2732, section 2:
1108 *[http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]:80/index.html 1]
1109 *[http://[1080:0:0:0:8:800:200C:417A]/index.html 2]
1110 *[http://[3ffe:2a00:100:7031::1] 3]
1111 *[http://[1080::8:800:200C:417A]/foo 4]
1112 *[http://[::192.9.5.5]/ipng 5]
1113 *[http://[::FFFF:129.144.52.38]:80/index.html 6]
1114 *[http://[2010:836B:4179::836B:4179] 7]
1116 <p><a rel="nofollow" class="external text" href="http://[2404:130:0:1000::187:2]/index.php">test</a>
1117 </p><p>Examples from <a class="external mw-magiclink-rfc" rel="nofollow" href="https://tools.ietf.org/html/rfc2373">RFC 2373</a>, section 2.2:
1119 <ul><li><a rel="nofollow" class="external text" href="http://[1080::8:800:200C:417A]">unicast</a></li>
1120 <li><a rel="nofollow" class="external text" href="http://[FF01::101]">multicast</a></li>
1121 <li><a rel="nofollow" class="external text" href="http://[::1]/">loopback</a></li>
1122 <li><a rel="nofollow" class="external text" href="http://[::]">unspecified</a></li>
1123 <li><a rel="nofollow" class="external text" href="http://[::13.1.68.3]">ipv4compat</a></li>
1124 <li><a rel="nofollow" class="external text" href="http://[::FFFF:129.144.52.38]">ipv4compat</a></li></ul>
1125 <p>Examples from <a class="external mw-magiclink-rfc" rel="nofollow" href="https://tools.ietf.org/html/rfc2732">RFC 2732</a>, section 2:
1127 <ul><li><a rel="nofollow" class="external text" href="http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]:80/index.html">1</a></li>
1128 <li><a rel="nofollow" class="external text" href="http://[1080:0:0:0:8:800:200C:417A]/index.html">2</a></li>
1129 <li><a rel="nofollow" class="external text" href="http://[3ffe:2a00:100:7031::1]">3</a></li>
1130 <li><a rel="nofollow" class="external text" href="http://[1080::8:800:200C:417A]/foo">4</a></li>
1131 <li><a rel="nofollow" class="external text" href="http://[::192.9.5.5]/ipng">5</a></li>
1132 <li><a rel="nofollow" class="external text" href="http://[::FFFF:129.144.52.38]:80/index.html">6</a></li>
1133 <li><a rel="nofollow" class="external text" href="http://[2010:836B:4179::836B:4179]">7</a></li></ul>
1135 <p><a rel="mw:ExtLink" href="http://[2404:130:0:1000::187:2]/index.php" class="external text">test</a></p>
1137 <p>Examples from <a href="https://tools.ietf.org/html/rfc2373" rel="mw:ExtLink" class="external mw-magiclink">RFC 2373</a>, section 2.2:</p>
1138 <ul><li><a rel="mw:ExtLink" href="http://[1080::8:800:200C:417A]" class="external text">unicast</a></li>
1139 <li><a rel="mw:ExtLink" href="http://[FF01::101]" class="external text">multicast</a></li>
1140 <li><a rel="mw:ExtLink" href="http://[::1]/" class="external text">loopback</a></li>
1141 <li><a rel="mw:ExtLink" href="http://[::]" class="external text">unspecified</a></li>
1142 <li><a rel="mw:ExtLink" href="http://[::13.1.68.3]" class="external text">ipv4compat</a></li>
1143 <li><a rel="mw:ExtLink" href="http://[::FFFF:129.144.52.38]" class="external text">ipv4compat</a></li></ul>
1145 <p>Examples from <a href="https://tools.ietf.org/html/rfc2732" rel="mw:ExtLink" class="external mw-magiclink">RFC 2732</a>, section 2:</p>
1146 <ul><li><a rel="mw:ExtLink" href="http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]:80/index.html" class="external text">1</a></li>
1147 <li><a rel="mw:ExtLink" href="http://[1080:0:0:0:8:800:200C:417A]/index.html" class="external text">2</a></li>
1148 <li><a rel="mw:ExtLink" href="http://[3ffe:2a00:100:7031::1]" class="external text">3</a></li>
1149 <li><a rel="mw:ExtLink" href="http://[1080::8:800:200C:417A]/foo" class="external text">4</a></li>
1150 <li><a rel="mw:ExtLink" href="http://[::192.9.5.5]/ipng" class="external text">5</a></li>
1151 <li><a rel="mw:ExtLink" href="http://[::FFFF:129.144.52.38]:80/index.html" class="external text">6</a></li>
1152 <li><a rel="mw:ExtLink" href="http://[2010:836B:4179::836B:4179]" class="external text">7</a></li></ul>
1156 Non-extlinks in brackets
1165 [{{1x|foo}} ''bar'']
1166 [{{1x|foo}}l's] errand
1167 [{{1x|foo}}l's errand]
1169 [url=http://example.com]
1170 [http:// bare protocols don't count]
1183 [url=<a rel="nofollow" class="external free" href="http://example.com">http://example.com</a>]
1184 [http:// bare protocols don't count]
1192 [<span about="#mwt19" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"1x","href":"./Template:1x"},"params":{"1":{"wt":"foo"}},"i":0}}]}'>foo</span>]
1193 [<span about="#mwt20" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"1x","href":"./Template:1x"},"params":{"1":{"wt":"foo"}},"i":0}}]}'>foo</span> bar]
1194 [<span about="#mwt21" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"1x","href":"./Template:1x"},"params":{"1":{"wt":"foo"}},"i":0}}]}'>foo</span> <i>bar</i>]
1195 [<span about="#mwt22" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"1x","href":"./Template:1x"},"params":{"1":{"wt":"foo"}},"i":0}}]}'>foo</span>l's] errand
1196 [<span about="#mwt23" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"1x","href":"./Template:1x"},"params":{"1":{"wt":"foo"}},"i":0}}]}'>foo</span>l's errand]
1197 [url=<span about="#mwt24" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"1x","href":"./Template:1x"},"params":{"1":{"wt":"foo"}},"i":0}}]}'>foo</span>]
1198 [url=<a rel="mw:ExtLink" href="http://example.com" class="external free">http://example.com</a>]
1199 [http:// bare protocols don't count]</p>
1203 Percent encoding in external links
1205 [https://github.com/search?l=&q=ResourceLoader+%40wikimedia Search]
1207 <p><a rel="nofollow" class="external text" href="https://github.com/search?l=&q=ResourceLoader+%40wikimedia">Search</a>
1210 <p><a rel="mw:ExtLink" href="https://github.com/search?l=&q=ResourceLoader+%40wikimedia" class="external text">Search</a></p>
1214 Use url link syntax for links where the content is equal the link target
1218 <p><a rel="nofollow" class="external free" href="http://example.com">http://example.com</a>
1221 <p><a rel="mw:ExtLink" href="http://example.com" class="external free">http://example.com</a></p>
1225 Parenthesis in external links, especially URL links
1229 http://example.com/test)
1231 http://example.com/(test)
1233 http://example.com/((test)
1235 (http://example.com/(test))
1237 (http://example.com/(test)))))
1239 http://example.com/a)b
1241 [http://example.com) foo]
1243 <p><a rel="nofollow" class="external free" href="http://example.com">http://example.com</a>)
1244 </p><p><a rel="nofollow" class="external free" href="http://example.com/test">http://example.com/test</a>)
1245 </p><p><a rel="nofollow" class="external free" href="http://example.com/(test)">http://example.com/(test)</a>
1246 </p><p><a rel="nofollow" class="external free" href="http://example.com/((test)">http://example.com/((test)</a>
1247 </p><p>(<a rel="nofollow" class="external free" href="http://example.com/(test))">http://example.com/(test))</a>
1248 </p><p>(<a rel="nofollow" class="external free" href="http://example.com/(test)))))">http://example.com/(test)))))</a>
1249 </p><p><a rel="nofollow" class="external free" href="http://example.com/a)b">http://example.com/a)b</a>
1250 </p><p><a rel="nofollow" class="external text" href="http://example.com)">foo</a>
1253 <p><a rel="mw:ExtLink" href="http://example.com" class="external free">http://example.com</a>)</p>
1254 <p><a rel="mw:ExtLink" href="http://example.com/test" class="external free">http://example.com/test</a>)</p>
1255 <p><a rel="mw:ExtLink" href="http://example.com/(test)" class="external free">http://example.com/(test)</a></p>
1256 <p><a rel="mw:ExtLink" href="http://example.com/((test)" class="external free">http://example.com/((test)</a></p>
1257 <p>(<a rel="mw:ExtLink" href="http://example.com/(test))" class="external free">http://example.com/(test))</a></p>
1258 <p>(<a rel="mw:ExtLink" href="http://example.com/(test)))))" class="external free">http://example.com/(test)))))</a></p>
1259 <p><a rel="mw:ExtLink" href="http://example.com/a)b" class="external free">http://example.com/a)b</a></p>
1260 <p><a rel="mw:ExtLink" href="http://example.com)" class="external text">foo</a></p>
1264 Parenthesis in external links, w/ transclusion or comment
1266 (http://example.com/{{1x|hi}})
1268 (http://example.com<!-- hi -->)
1270 <p>(<a rel="nofollow" class="external free" href="http://example.com/hi">http://example.com/hi</a>)
1271 </p><p>(<a rel="nofollow" class="external free" href="http://example.com">http://example.com</a>)
1274 <p>(<a typeof="mw:ExpandedAttrs" about="#mwt2" rel="mw:ExtLink" href="http://example.com/hi" class="external free" data-parsoid='{"stx":"url","a":{"href":"http://example.com/hi"},"sa":{"href":"http://example.com/{{1x|hi}}"}}' data-mw='{"attribs":[[{"txt":"href"},{"html":"http://example.com/<span about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[{\"k\":\"1\"}]]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"1x\",\"href\":\"./Template:1x\"},\"params\":{\"1\":{\"wt\":\"hi\"}},\"i\":0}}]}'>hi</span>"}]]}'>http://example.com/hi</a>)</p>
1276 <p>(<a rel="mw:ExtLink" href="http://example.com" class="external free" data-parsoid='{"stx":"url","a":{"href":"http://example.com"},"sa":{"href":"http://example.com<!-- hi -->"}}'>http://example.com</a>)</p>
1279 ### Parsoid-specific tests
1282 mw:ExtLink linking to a interwiki URL can be round-tripped losslessly (T94723)
1286 [http://en.wikipedia.org/wiki/European_Robin European Robin]
1288 THIS SECTION IS NOT USED (but Parsoid won't run the test without it)
1292 Parsoid extlink with _blank target
1294 externallinktarget=_blank
1296 [https://www.example.com]
1298 <p><a rel="mw:ExtLink nofollow noreferrer noopener" href="https://www.example.com" class="external autonumber" target="_blank"></a></p>
1300 <p><a target="_blank" rel="nofollow noreferrer noopener" class="external autonumber" href="https://www.example.com">[1]</a>
1305 Parsoid extlink with _self target
1307 externallinktarget=_self
1309 [https://www.example.com]
1311 <p><a rel="mw:ExtLink nofollow" href="https://www.example.com" class="external autonumber" target="_self"></a></p>
1313 <p><a target="_self" rel="nofollow" class="external autonumber" href="https://www.example.com">[1]</a>
1318 Extlink in square brackets with entity
1320 [ [http://test.com 123] ]
1322 [http://test.com [123]
1324 <p>[ <a rel="nofollow" class="external text" href="http://test.com">123</a> ]
1325 </p><p><a rel="nofollow" class="external text" href="http://test.com">[123</a>
1328 <p>[<span typeof="mw:Entity"> </span><a rel="mw:ExtLink nofollow" href="http://test.com" class="external text">123</a><span typeof="mw:Entity"> </span>]</p>
1330 <p><a rel="mw:ExtLink nofollow" href="http://test.com" class="external text">[123</a></p>