Skip to content

Commit

Permalink
Examples update
Browse files Browse the repository at this point in the history
  • Loading branch information
Vitaly Puzrin committed Feb 12, 2015
1 parent 2fb1916 commit b73a42f
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 17 deletions.
52 changes: 35 additions & 17 deletions support/demo_template/sample.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,23 @@ http://example.com?foo=bar
http://example.com/#foo=bar
http://example.com#foo=bar
http://a.in
HTTP://GOOGLE.COM
http://example.invalid // don't restrict root domain when schema exists


%
% localhost
% localhost (only with protocol allowed)
%
localhost
localhost/
//localhost
http://localhost:8000?
http://localhost:8000


%
% SSL
% Other protocols
%
My ssl https://example.com site
My ftp://example.com site


%
% Neutral proto
Expand All @@ -39,32 +43,35 @@ My ssl //example.com site
4.4.4.4
192.168.1.1/abc


%
% Fuzzy
%
test.example@http://vk.com
text:http://example.com/
http://example.com/
google.com
google.com: // no port
s.l.o.w.io
a-b.com
GOOGLE.COM.
google.xxx // known tld


%
% Correct termination for . , [] {} () ""
% Correct termination for . , ! ? [] {} () "" ''
%
(Scoped http://example.com/foo_bar)
http://example.com/foo_bar_(wiki)
http://foo.com/blah_blah_[other]
http://foo.com/blah_blah_{I'm_king}
http://foo.com/blah_blah_I'm_king
http://foo.com/blah_blah_"doublequoted"
http://foo.com/blah_blah_'singlequoted'
(Scoped like http://example.com/foo_bar)
[Scoped like http://example.com/foo_bar]
{Scoped like http://example.com/foo_bar}
"Quoted like http://example.com/foo_bar"
http://example.com/foo_bar
'Quoted like http://example.com/foo_bar'
[example.com/foo_bar.jpg)]
http://example.com/foo_bar.jpg.
http://example.com/foo_bar/.
Expand All @@ -73,15 +80,25 @@ http://example.com/foo_bar?p=10.
https://www.google.ru/maps/@59.9393895,30.3165389,15z?hl=ru
https://www.google.com/maps/place/New+York,+NY,+USA/@40.702271,-73.9968471,11z/data=!4m2!3m1!1s0x89c24fa5d33f083b:0xc80b8f06e177fe62?hl=en
https://www.google.com/analytics/web/?hl=ru&pli=1#report/visitors-overview/a26895874w20458057p96934174/
http://business.timesonline.co.uk/article/0,,9065-2473189,00.html
http://example.com/123!
http://example.com/foo--bar
http://example.com/foo---bar % Markdown dash
http://example.com/foo----bar

%
% Emails
%
ame@example.com

test."foo".bar@gmail.co.uk!
name@example.com
mailto:name@example.com
MAILTO:NAME@EXAMPLE.COM
mailto:foo_bar@example.com
foo+bar@gmail.com
192.168.1.1@gmail.com
mailto:foo@bar % explicit protocol make it valid


%
% International
Expand All @@ -95,33 +112,34 @@ example.com/䨹
xn--d1abbgf6aiiy.xn--p1ai



%
% NOT links
% Not links
%
example.invalid
example.invalid/
http://example.invalid
http://example.com.invalid/
http://.example.com
http://-example.com
hppt://example.com
example.coma
-example.coma
foo.123
http://a.b--c.de/
http://a.b--c.de/ % `--` disabled, because collision possible
localhost % only with protocol allowed
localhost/

_http://example.com
_//example.com
_example.com
http://example.com_

http://
http://.
http://..
http://#
http://##
http://?
http://??
google.com:500000
google.com:500000 // invalid port
show image.jpg
path:to:file.pm
/path/to/file.pl
Expand All @@ -139,5 +157,5 @@ a1.2.3.4
%
% Not email
%
foo@bar
mailto:foo@bar
foo@bar % Should be at second level domain & with correct tld
mailto:bar
3 changes: 3 additions & 0 deletions test/fixtures/not_links.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
%
% Not links
%
example.invalid
example.invalid/
http://.example.com
Expand Down

0 comments on commit b73a42f

Please sign in to comment.