Changeset 545 for trunk/tests


Ignore:
Timestamp:
Aug 19, 2015 4:18:55 AM (9 years ago)
Author:
anonymous
Message:

Updated hyperlinkTxt function

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/UtilitiesTest.php

    r541 r545  
    5050    {
    5151        $urls = [
    52             ' http://www.asdf.com/ ' => ' <a href="http://www.asdf.com/">www.asdf.com/</a> ',
    53             ' www.asdf.com/ ' => ' <a href="http://www.asdf.com/">www.asdf.com/</a> ',
    54             ' www.asdf.com/? ' => ' <a href="http://www.asdf.com/">www.asdf.com/</a>? ',
     52            ' http://www.asdf.com/ ' => ' <a href="http://www.asdf.com/">www.asdf.com</a> ',
     53            ' ws://www.asdf.com/ ' => ' <a href="ws://www.asdf.com/">ws://www.asdf.com/</a> ',
     54            ' sftp://user@host.tld:22/path/x ' => ' <a href="sftp://user@host.tld:22/path/x">sftp://user@host.tld:22/path/x</a> ',
     55            ' www.asdf.com/ ' => ' <a href="http://www.asdf.com/">www.asdf.com</a> ',
     56            ' http://asdf/ ' => ' <a href="http://asdf/">asdf</a> ',
     57            ' www.asdf.com/? ' => ' <a href="http://www.asdf.com/">www.asdf.com</a>? ',
    5558            ' www.asdf.com/?x=y+z ' => ' <a href="http://www.asdf.com/?x=y+z">www.asdf.com/?x=y+z</a> ',
    5659            ' www.asdf.com/?x=y+ ' => ' <a href="http://www.asdf.com/?x=y+">www.asdf.com/?x=y+</a> ',
     
    7982            ' http://✪df.ws/123 ' => ' <a href="http://✪df.ws/123">✪df.ws/123</a> ',
    8083            ' http://userid:password@example.com:8080 ' => ' <a href="http://userid:password@example.com:8080">userid:password@example.com:8080</a> ',
    81             ' http://userid:password@example.com:8080/ ' => ' <a href="http://userid:password@example.com:8080/">userid:password@example.com:8080/</a> ',
     84            ' http://userid:password@example.com:8080/ ' => ' <a href="http://userid:password@example.com:8080/">userid:password@example.com:8080</a> ',
    8285            ' http://userid@example.com ' => ' <a href="http://userid@example.com">userid@example.com</a> ',
    83             ' http://userid@example.com/ ' => ' <a href="http://userid@example.com/">userid@example.com/</a> ',
     86            ' http://userid@example.com/ ' => ' <a href="http://userid@example.com/">userid@example.com</a> ',
    8487            ' http://userid@example.com:8080 ' => ' <a href="http://userid@example.com:8080">userid@example.com:8080</a> ',
    85             ' http://userid@example.com:8080/ ' => ' <a href="http://userid@example.com:8080/">userid@example.com:8080/</a> ',
     88            ' http://userid@example.com:8080/ ' => ' <a href="http://userid@example.com:8080/">userid@example.com:8080</a> ',
    8689            ' http://userid:password@example.com ' => ' <a href="http://userid:password@example.com">userid:password@example.com</a> ',
    87             ' http://userid:password@example.com/ ' => ' <a href="http://userid:password@example.com/">userid:password@example.com/</a> ',
    88             ' http://142.42.1.1/ ' => ' <a href="http://142.42.1.1/">142.42.1.1/</a> ',
    89             ' http://142.42.1.1:8080/ ' => ' <a href="http://142.42.1.1:8080/">142.42.1.1:8080/</a> ',
     90            ' http://userid:password@example.com/ ' => ' <a href="http://userid:password@example.com/">userid:password@example.com</a> ',
     91            ' http://142.42.1.1/ ' => ' <a href="http://142.42.1.1/">142.42.1.1</a> ',
     92            ' http://142.42.1.1:8080/ ' => ' <a href="http://142.42.1.1:8080/">142.42.1.1:8080</a> ',
    9093            ' http://➡.ws/äš¹ ' => ' <a href="http://➡.ws/äš¹">➡.ws/äš¹</a> ',
    9194            ' http://⌘.ws ' => ' <a href="http://⌘.ws">⌘.ws</a> ',
    92             ' http://⌘.ws/ ' => ' <a href="http://⌘.ws/">⌘.ws/</a> ',
     95            ' http://⌘.ws/ ' => ' <a href="http://⌘.ws/">⌘.ws</a> ',
    9396            ' http://foo.com/blah_(wikipedia)#cite-1 ' => ' <a href="http://foo.com/blah_(wikipedia)#cite-1">foo.com/blah_(wikipedia)#cite-1</a> ',
    9497            ' http://foo.com/blah_(wikipedia)_blah#cite-1 ' => ' <a href="http://foo.com/blah_(wikipedia)_blah#cite-1">foo.com/blah_(wikipedia)_blah#cite-1</a> ',
    9598            ' http://foo.com/unicode_(✪)_in_parens ' => ' <a href="http://foo.com/unicode_(✪)_in_parens">foo.com/unicode_(✪)_in_parens</a> ',
    9699            ' http://foo.com/(something)?after=parens ' => ' <a href="http://foo.com/(something)?after=parens">foo.com/(something)?after=parens</a> ',
    97             ' http://☺.damowmow.com/ ' => ' <a href="http://☺.damowmow.com/">☺.damowmow.com/</a> ',
     100            ' http://☺.damowmow.com/ ' => ' <a href="http://☺.damowmow.com/">☺.damowmow.com</a> ',
    98101            ' http://code.google.com/events/#&product=browser ' => ' <a href="http://code.google.com/events/#&amp;product=browser">code.google.com/events/#&product=browser</a> ',
    99102            ' http://j.mp ' => ' <a href="http://j.mp">j.mp</a> ',
    100             ' ftp://foo.bar/baz ' => ' <a href="ftp://foo.bar/baz">foo.bar/baz</a> ',
     103            ' ftp://foo.bar/baz ' => ' <a href="ftp://foo.bar/baz">ftp://foo.bar/baz</a> ',
    101104            ' http://foo.bar/?q=Test%20URL-encoded%20stuff ' => ' <a href="http://foo.bar/?q=Test%20URL-encoded%20stuff">foo.bar/?q=Test%20URL-encoded%20stuff</a> ',
    102105            ' http://Ù
     
    116119            ' https://github.com/search?q=gif&utf8=✓ ' => ' <a href="https://github.com/search?q=gif&amp;utf8=✓">github.com/search?q=gif&utf8=✓</a> ',
    117120
     121            // These should fail.
     122            ' http://x and.co OK?' => ' http://x and.co OK?',
     123            ' www. ' => ' www. ',
     124            ' www.x ' => ' www.x ',
     125            ' http: ' => ' http: ',
     126            ' http:// ' => ' http:// ',
     127            ' http:x ' => ' http:x ',
     128            ' http://x ' => ' http://x ',
     129            ' http://x/ ' => ' http://x/ ',
     130            ' http:// ?.x.com/ ' => ' http:// ?.x.com/ ',
     131            ' http://?.com/ ' => ' http://?.com/ ',
     132            ' http://.?.com/ ' => ' http://.?.com/ ',
     133
    118134            // These are allowed to fuckup due to limitations in our ability to be omnipotent.
    119             ' <a href=http://www.example.com/ > http://www.example.com/</a> ' => ' <a href=http://www.example.com/ > <a href="http://www.example.com/">www.example.com/</a></a> ',
     135            ' http:// www.x.com/ ' => ' http:// <a href="http://www.x.com/">www.x.com</a> ',
     136            ' <a href=http://www.example.com/ > http://www.example.com/</a> ' => ' <a href=http://www.example.com/ > <a href="http://www.example.com/">www.example.com</a></a> ',
     137
     138            '<a href="http://www.example.com">Lorem ipsum</a> <a href="sftp://user@host.tld/path">dolor sit amet</a> sftp://user@host.tld/path, [http://www.example.com/ consetetur] sadipscing elitr, (sed diam) www.example.com! Nonumy http://x.com! Invidunt mailto:asdf@asdf.com ut <a href="mailto:asdf@asdf.com">asdf@asdf.com</a> \'\'\'et dolore\'\'\' magna. <!-- comment -->  Aliquyam:erat, sed://diam //voluptua//. At vero.eos.et {{{ for (var i = Things.length - 1; i >= 0; i--) { Things[i]; } }}} `http://x.com` justo duo doloreshttp://www.not.com!' => '<a href="http://www.example.com">Lorem ipsum</a> <a href="sftp://user@host.tld/path">dolor sit amet</a> <a href="sftp://user@host.tld/path">sftp://user@host.tld/path</a>, [<a href="http://www.example.com/">www.example.com</a> consetetur] sadipscing elitr, (sed diam) <a href="http://www.example.com">www.example.com</a>! Nonumy <a href="http://x.com">x.com</a>! Invidunt <a href="mailto:asdf@asdf.com">mailto:asdf@asdf.com</a> ut <a href="mailto:asdf@asdf.com">asdf@asdf.com</a> \'\'\'et dolore\'\'\' magna. <!-- comment -->  Aliquyam:erat, <a href="sed://diam">sed://diam</a> //voluptua//. At vero.eos.et {{{ for (var i = Things.length - 1; i >= 0; i--) { Things[i]; } }}} `http://x.com` justo duo <a href="doloreshttp://www.not.com">doloreshttp://www.not.com</a>!',
     139        ];
     140
     141        $urls_strict = [
     142            ' http://www.asdf.com/ ' => ' <a href="http://www.asdf.com/">www.asdf.com</a> ',
     143            ' ws://www.asdf.com/ ' => ' <a href="ws://www.asdf.com/">ws://www.asdf.com/</a> ',
     144            ' sftp://user@host.tld:22/path/x ' => ' <a href="sftp://user@host.tld:22/path/x">sftp://user@host.tld:22/path/x</a> ',
     145            ' sip:beer ' => ' <a href="sip:beer">sip:beer</a> ',
     146            ' http://asdf/ ' => ' <a href="http://asdf/">asdf</a> ',
     147            ' http://www.asdf.com/? ' => ' <a href="http://www.asdf.com/?">www.asdf.com/?</a> ',
     148            ' http://www.asdf.com/?x=y+z ' => ' <a href="http://www.asdf.com/?x=y+z">www.asdf.com/?x=y+z</a> ',
     149            ' http://www.asdf.com/?x=y+ ' => ' <a href="http://www.asdf.com/?x=y+">www.asdf.com/?x=y+</a> ',
     150            ' http://www.asdf.com/?x= ' => ' <a href="http://www.asdf.com/?x=">www.asdf.com/?x=</a> ',
     151            ' http://www.asdf.com/?x ' => ' <a href="http://www.asdf.com/?x">www.asdf.com/?x</a> ',
     152            ' https://www.asdf.com/?❀=🔥 ' => ' <a href="https://www.asdf.com/?❀=🔥">www.asdf.com/?❀=🔥</a> ',
     153            ' www.asdf.com? ' => ' www.asdf.com? ',
     154            ' www.asdf.com/ ' => ' www.asdf.com/ ',
     155            ' www.asdf.com/? ' => ' www.asdf.com/? ',
     156            ' www.asdf.com/?x=y+z ' => ' www.asdf.com/?x=y+z ',
     157            ' www.asdf.com/?x=y+ ' => ' www.asdf.com/?x=y+ ',
     158            ' www.asdf.com/?x= ' => ' www.asdf.com/?x= ',
     159            ' www.asdf.com/?x ' => ' www.asdf.com/?x ',
     160            ' www.asdf.com/?❀=🔥 ' => ' www.asdf.com/?❀=🔥 ',
     161            ' www.asdf.com! ' => ' www.asdf.com! ',
     162            ' www.asdf.com. ' => ' www.asdf.com. ',
     163            ' `www.asdf.com` ' => ' `www.asdf.com` ',
     164            ' "www.asdf.com" ' => ' "www.asdf.com" ',
     165            ' <www.asdf.com> ' => ' <www.asdf.com> ',
     166            ' `http://www.asdf.com` ' => ' `http://www.asdf.com` ',
     167            ' "http://www.asdf.com" ' => ' "http://www.asdf.com" ',
     168            ' <http://www.asdf.com> ' => ' <<a href="http://www.asdf.com">www.asdf.com</a>> ',
     169            ' (http://www.asdf.com) ' => ' (<a href="http://www.asdf.com)">www.asdf.com)</a> ',
     170            ' (URL: http://www.asdf.com#1) ' => ' (URL: <a href="http://www.asdf.com#1)">www.asdf.com#1)</a> ',
     171            ' <a href="http://www.example.com/">Click Here</a> ' => ' <a href="http://www.example.com/">Click Here</a> ',
     172            ' <a href="http://www.example.com/">http://www.example.com/</a> ' => ' <a href="http://www.example.com/">http://www.example.com/</a> ',
     173            ' <a href=http://www.example.com/>http://www.example.com/</a> ' => ' <a href=http://www.example.com/>http://www.example.com/</a> ',
     174            ' <a href=\'http://www.example.com/\' >http://www.example.com/</a> ' => ' <a href=\'http://www.example.com/\' >http://www.example.com/</a> ',
     175            ' http://foo.com/blah_blah ' => ' <a href="http://foo.com/blah_blah">foo.com/blah_blah</a> ',
     176            ' http://foo.com/blah_blah/ ' => ' <a href="http://foo.com/blah_blah/">foo.com/blah_blah/</a> ',
     177            ' http://foo.com/blah_blah_(wikipedia) ' => ' <a href="http://foo.com/blah_blah_(wikipedia)">foo.com/blah_blah_(wikipedia)</a> ',
     178            ' http://foo.com/blah_blah_(wikipedia)_(again) ' => ' <a href="http://foo.com/blah_blah_(wikipedia)_(again)">foo.com/blah_blah_(wikipedia)_(again)</a> ',
     179            ' http://www.example.com/wpstyle/?p=364 ' => ' <a href="http://www.example.com/wpstyle/?p=364">www.example.com/wpstyle/?p=364</a> ',
     180            ' https://www.example.com/foo/?bar=baz&inga=42&quux ' => ' <a href="https://www.example.com/foo/?bar=baz&amp;inga=42&amp;quux">www.example.com/foo/?bar=baz&inga=42&quux</a> ',
     181            ' http://✪df.ws/123 ' => ' <a href="http://✪df.ws/123">✪df.ws/123</a> ',
     182            ' http://userid:password@example.com:8080 ' => ' <a href="http://userid:password@example.com:8080">userid:password@example.com:8080</a> ',
     183            ' http://userid:password@example.com:8080/ ' => ' <a href="http://userid:password@example.com:8080/">userid:password@example.com:8080</a> ',
     184            ' http://userid@example.com ' => ' <a href="http://userid@example.com">userid@example.com</a> ',
     185            ' http://userid@example.com/ ' => ' <a href="http://userid@example.com/">userid@example.com</a> ',
     186            ' http://userid@example.com:8080 ' => ' <a href="http://userid@example.com:8080">userid@example.com:8080</a> ',
     187            ' http://userid@example.com:8080/ ' => ' <a href="http://userid@example.com:8080/">userid@example.com:8080</a> ',
     188            ' http://userid:password@example.com ' => ' <a href="http://userid:password@example.com">userid:password@example.com</a> ',
     189            ' http://userid:password@example.com/ ' => ' <a href="http://userid:password@example.com/">userid:password@example.com</a> ',
     190            ' http://142.42.1.1/ ' => ' <a href="http://142.42.1.1/">142.42.1.1</a> ',
     191            ' http://142.42.1.1:8080/ ' => ' <a href="http://142.42.1.1:8080/">142.42.1.1:8080</a> ',
     192            ' http://➡.ws/äš¹ ' => ' <a href="http://➡.ws/äš¹">➡.ws/äš¹</a> ',
     193            ' http://⌘.ws ' => ' <a href="http://⌘.ws">⌘.ws</a> ',
     194            ' http://⌘.ws/ ' => ' <a href="http://⌘.ws/">⌘.ws</a> ',
     195            ' http://foo.com/blah_(wikipedia)#cite-1 ' => ' <a href="http://foo.com/blah_(wikipedia)#cite-1">foo.com/blah_(wikipedia)#cite-1</a> ',
     196            ' http://foo.com/blah_(wikipedia)_blah#cite-1 ' => ' <a href="http://foo.com/blah_(wikipedia)_blah#cite-1">foo.com/blah_(wikipedia)_blah#cite-1</a> ',
     197            ' http://foo.com/unicode_(✪)_in_parens ' => ' <a href="http://foo.com/unicode_(✪)_in_parens">foo.com/unicode_(✪)_in_parens</a> ',
     198            ' http://foo.com/(something)?after=parens ' => ' <a href="http://foo.com/(something)?after=parens">foo.com/(something)?after=parens</a> ',
     199            ' http://☺.damowmow.com/ ' => ' <a href="http://☺.damowmow.com/">☺.damowmow.com</a> ',
     200            ' http://code.google.com/events/#&product=browser ' => ' <a href="http://code.google.com/events/#&amp;product=browser">code.google.com/events/#&product=browser</a> ',
     201            ' http://j.mp ' => ' <a href="http://j.mp">j.mp</a> ',
     202            ' ftp://foo.bar/baz ' => ' <a href="ftp://foo.bar/baz">ftp://foo.bar/baz</a> ',
     203            ' http://foo.bar/?q=Test%20URL-encoded%20stuff ' => ' <a href="http://foo.bar/?q=Test%20URL-encoded%20stuff">foo.bar/?q=Test%20URL-encoded%20stuff</a> ',
     204            ' http://Ù
     205ثال.إختؚار ' => ' <a href="http://Ù
     206ثال.إختؚار">Ù
     207ثال.إختؚار</a> ',
     208            ' http://䟋子.测试 ' => ' <a href="http://䟋子.测试">䟋子.测试</a> ',
     209            ' http://à€‰à€Šà€Ÿà€¹à€°à€£.à€ªà€°à¥€à€•à¥à€·à€Ÿ ' => ' <a href="http://à€‰à€Šà€Ÿà€¹à€°à€£.à€ªà€°à¥€à€•à¥à€·à€Ÿ">à€‰à€Šà€Ÿà€¹à€°à€£.à€ªà€°à¥€à€•à¥à€·à€Ÿ</a> ',
     210            ' http://-.~_!$&\'()*+,;=:%40:80%2f::::::@example.com ' => ' <a href="http://-.~_!$&amp;&#039;()*+,;=:%40:80%2f::::::@example.com">-.~_!$&\'()*+,;=:%40:80%2f::::::@example.com</a> ',
     211            ' http://1337.net ' => ' <a href="http://1337.net">1337.net</a> ',
     212            ' http://a.b-c.de ' => ' <a href="http://a.b-c.de">a.b-c.de</a> ',
     213            ' http://223.255.255.254 ' => ' <a href="http://223.255.255.254">223.255.255.254</a> ',
     214            ' http://foo.bar?q=Spaces should be encoded ' => ' <a href="http://foo.bar?q=Spaces">foo.bar?q=Spaces</a> should be encoded ',
     215            ' https://github.com/search?utf8=✓&q=gif ' => ' <a href="https://github.com/search?utf8=✓&amp;q=gif">github.com/search?utf8=✓&q=gif</a> ',
     216            ' https://github.com/search?q=gif&utf8=* ' => ' <a href="https://github.com/search?q=gif&amp;utf8=*">github.com/search?q=gif&utf8=*</a> ',
     217            ' https://github.com/search?q=gif&utf8=✓ ' => ' <a href="https://github.com/search?q=gif&amp;utf8=✓">github.com/search?q=gif&utf8=✓</a> ',
     218
     219            // Unusual schemes.
     220            ' view-source:https://trac.strangecode.com/x/ticket/2#comment:4 ' => ' <a href="view-source:https://trac.strangecode.com/x/ticket/2#comment:4">view-source:https://trac.strangecode.com/x/ticket/2#comment:4</a> ',
     221            ' mailto:asdf@asdf.com ' => ' <a href="mailto:asdf@asdf.com">mailto:asdf@asdf.com</a> ',
     222            ' facetime://+19995551234 ' => ' <a href="facetime://+19995551234">facetime://+19995551234</a> ',
     223            ' tel:+15552001010 ' => ' <a href="tel:+15552001010">tel:+15552001010</a> ',
     224            ' magnet:?xt=urn:ed2k:354B15E68FB8F36D7CD88FF94116CDC1&xt=urn:tree:tiger:7N5OAMRNGMSSEUE3ORHOKWN4WWIQ5X4EBOOTLJY&xt=urn:btih:QHQXPYWMACKDWKP47RRVIV7VOURXFE5Q&xl=10826029&dn=mediawiki-1.15.1.tar.gz&tr=udp%3A%2F%2Ftracker.openbittorrent.com%3A80%2Fannounce&as=http%3A%2F%2Fdownload.wikimedia.org%2Fmediawiki%2F1.15%2Fmediawiki-1.15.1.tar.gz&xs=http%3A%2F%2Fcache.example.org%2FXRX2PEFXOOEJFRVUCX6HMZMKS5TWG4K5&xs=dchub://example.org ' => ' <a href="magnet:?xt=urn:ed2k:354B15E68FB8F36D7CD88FF94116CDC1&amp;xt=urn:tree:tiger:7N5OAMRNGMSSEUE3ORHOKWN4WWIQ5X4EBOOTLJY&amp;xt=urn:btih:QHQXPYWMACKDWKP47RRVIV7VOURXFE5Q&amp;xl=10826029&amp;dn=mediawiki-1.15.1.tar.gz&amp;tr=udp%3A%2F%2Ftracker.openbittorrent.com%3A80%2Fannounce&amp;as=http%3A%2F%2Fdownload.wikimedia.org%2Fmediawiki%2F1.15%2Fmediawiki-1.15.1.tar.gz&amp;xs=http%3A%2F%2Fcache.example.org%2FXRX2PEFXOOEJFRVUCX6HMZMKS5TWG4K5&amp;xs=dchub://example.org">magnet:?xt=urn:ed2k:354B15E68FB8F36D7CD88FF94116CDC1&xt=urn:tree:tiger:7N5OAMRNGMSSEUE3ORHOKWN4WWIQ5X4EBOOTLJY&xt=urn:btih:QHQXPYWMACKDWKP47RRVIV7VOURXFE5Q&xl=10826029&dn=mediawiki-1.15.1.tar.gz&tr=udp%3A%2F%2Ftracker.openbittorrent.com%3A80%2Fannounce&as=http%3A%2F%2Fdownload.wikimedia.org%2Fmediawiki%2F1.15%2Fmediawiki-1.15.1.tar.gz&xs=http%3A%2F%2Fcache.example.org%2FXRX2PEFXOOEJFRVUCX6HMZMKS5TWG4K5&xs=dchub://example.org</a> ',
     225            ' chrome-extension://71f05c488a96b441ef679b09267ea46c/index.html ' => ' <a href="chrome-extension://71f05c488a96b441ef679b09267ea46c/index.html">chrome-extension://71f05c488a96b441ef679b09267ea46c/index.html</a> ',
     226
     227            // These should fail.
     228            ' http://x and.co OK?' => ' http://x and.co OK?',
     229            ' www. ' => ' www. ',
     230            ' www.x ' => ' www.x ',
     231            ' http: ' => ' http: ',
     232            ' http:// ' => ' http:// ',
     233            ' http:x ' => ' http:x ',
     234            ' http://x ' => ' http://x ',
     235            ' http://x/ ' => ' http://x/ ',
     236            ' http:// www.x.com/ ' => ' http:// www.x.com/ ',
     237            ' http://?.com/ ' => ' http://?.com/ ',
     238            ' http://.?.com/ ' => ' http://.?.com/ ',
     239
     240            // These are allowed to fuckup due to limitations in our ability to be omnipotent.
     241            ' <a href=http://www.example.com/ > http://www.example.com/</a> ' => ' <a href=http://www.example.com/ > <a href="http://www.example.com/">www.example.com</a></a> ',
     242            ' dummyhttp://www.asdf.com/ ' => ' <a href="dummyhttp://www.asdf.com/">dummyhttp://www.asdf.com/</a> ',
     243
     244            '<a href="http://www.example.com">Lorem ipsum</a> <a href="sftp://user@host.tld/path">dolor sit amet</a> sftp://user@host.tld/path, [http://www.example.com/ consetetur] sadipscing elitr, (sed diam) www.example.com! Nonumy http://x.com! Invidunt mailto:asdf@asdf.com ut <a href="mailto:asdf@asdf.com">asdf@asdf.com</a> \'\'\'et dolore\'\'\' magna. <!-- comment -->  Aliquyam:erat, sed://diam //voluptua//. At vero.eos.et {{{ for (var i = Things.length - 1; i >= 0; i--) { Things[i]; } }}} `http://x.com` justo duo doloreshttp://www.not.com!' => '<a href="http://www.example.com">Lorem ipsum</a> <a href="sftp://user@host.tld/path">dolor sit amet</a> <a href="sftp://user@host.tld/path,">sftp://user@host.tld/path,</a> [<a href="http://www.example.com/">www.example.com</a> consetetur] sadipscing elitr, (sed diam) www.example.com! Nonumy <a href="http://x.com!">x.com!</a> Invidunt <a href="mailto:asdf@asdf.com">mailto:asdf@asdf.com</a> ut <a href="mailto:asdf@asdf.com">asdf@asdf.com</a> \'\'\'et dolore\'\'\' magna. <!-- comment -->  Aliquyam:erat, <a href="sed://diam">sed://diam</a> //voluptua//. At vero.eos.et {{{ for (var i = Things.length - 1; i >= 0; i--) { Things[i]; } }}} `http://x.com` justo duo <a href="doloreshttp://www.not.com!">doloreshttp://www.not.com!</a>',
    120245        ];
    121246        foreach ($urls as $input => $expected) {
     
    123248            $this->assertEquals($expected, $result, sprintf('Failed with input: %s', $input));
    124249        }
     250        foreach ($urls_strict as $input => $expected) {
     251            // printf("'%s' => '%s',\n", $input, hyperlinkTxt($input, true));
     252            $result = hyperlinkTxt($input, true);
     253            $this->assertEquals($expected, $result, sprintf('Failed with input: %s', $input));
     254        }
    125255    }
    126256
Note: See TracChangeset for help on using the changeset viewer.