# Extensions This section describes the different extensions supported: ## AutoLinks Autolinks will format as a HTML link any string that starts by: - `http://` or `https://` - `ftp://` - `mailto:` - `tel:` - `www.` ```````````````````````````````` example This is a http://www.google.com URL and https://www.google.com This is a ftp://test.com And a mailto:email@toto.com And a tel:+1555123456 And a plain www.google.com .

This is a http://www.google.com URL and https://www.google.com This is a ftp://test.com And a email@toto.com And a +1555123456 And a plain www.google.com

```````````````````````````````` But incomplete links will not be matched: ```````````````````````````````` example This is not a http:/www.google.com URL and https:/www.google.com This is not a ftp:/test.com And not a mailto:emailtoto.com And not a plain www. or a www.x And not a tel: .

This is not a http:/www.google.com URL and https:/www.google.com This is not a ftp:/test.com And not a mailto:emailtoto.com And not a plain www. or a www.x And not a tel:

```````````````````````````````` Previous character must be a punctuation or a valid space (tab, space, new line): ```````````````````````````````` example This is not a nhttp://www.google.com URL but this is (https://www.google.com) .

This is not a nhttp://www.google.com URL but this is (https://www.google.com)

```````````````````````````````` An autolink should not interfere with an `` HTML inline: ```````````````````````````````` example This is an HTML http://www.google.com link .

This is an HTML http://www.google.com link

```````````````````````````````` or even within emphasis: ```````````````````````````````` example This is an HTML **http://www.google.com** link .

This is an HTML http://www.google.com link

```````````````````````````````` An autolink should not interfere with a markdown link: ```````````````````````````````` example This is an HTML [http://www.google.com](http://www.google.com) link .

This is an HTML http://www.google.com link

```````````````````````````````` A link embraced by pending emphasis should let the emphasis takes precedence if characters are placed at the end of the matched link: ```````````````````````````````` example Check **http://www.a.com** or __http://www.b.com__ .

Check http://www.a.com or http://www.b.com

```````````````````````````````` It is not mentioned by the spec, but empty emails won't be matched (only a subset of [RFC2368](https://tools.ietf.org/html/rfc2368) is supported by auto links): ```````````````````````````````` example mailto:email@test.com is okay, but mailto:@test.com is not .

email@test.com is okay, but mailto:@test.com is not

```````````````````````````````` ### GFM Support Extract from [GFM Autolinks extensions specs](https://github.github.com/gfm/#autolinks-extension-) ```````````````````````````````` example www.commonmark.org .

www.commonmark.org

```````````````````````````````` ```````````````````````````````` example Visit www.commonmark.org/help for more information. .

Visit www.commonmark.org/help for more information.

```````````````````````````````` ```````````````````````````````` example Visit www.commonmark.org. Visit www.commonmark.org/a.b. .

Visit www.commonmark.org.

Visit www.commonmark.org/a.b.

```````````````````````````````` ```````````````````````````````` example www.google.com/search?q=Markup+(business) (www.google.com/search?q=Markup+(business)) .

www.google.com/search?q=Markup+(business)

(www.google.com/search?q=Markup+(business))

```````````````````````````````` ```````````````````````````````` example www.google.com/search?q=commonmark&hl=en www.google.com/search?q=commonmark&hl; .

www.google.com/search?q=commonmark&hl=en

www.google.com/search?q=commonmark&hl;

```````````````````````````````` ```````````````````````````````` example www.commonmark.org/hewww.commonmark.org/he<lp

```````````````````````````````` ```````````````````````````````` example http://commonmark.org (Visit https://encrypted.google.com/search?q=Markup+(business)) Anonymous FTP is available at ftp://foo.bar.baz. .

http://commonmark.org

(Visit https://encrypted.google.com/search?q=Markup+(business))

Anonymous FTP is available at ftp://foo.bar.baz.

```````````````````````````````` ### Valid Domain Tests Domain names that have empty segments won't be matched ```````````````````````````````` example www.. www..com http://test. http://.test http://. http://.. ftp://test. ftp://.test mailto:email@test. mailto:email@.test .

www.. www..com http://test. http://.test http://. http://.. ftp://test. ftp://.test mailto:email@test. mailto:email@.test

```````````````````````````````` Domain names with too few segments won't be matched ```````````````````````````````` example www www.com http://test ftp://test mailto:email@test .

www www.com http://test ftp://test mailto:email@test

```````````````````````````````` Domain names that contain an underscores in the last two segments won't be matched ```````````````````````````````` example www._test.foo.bar is okay, but www._test.foo is not http://te_st.foo.bar is okay, as is http://test.foo_.bar.foo But http://te_st.foo, http://test.foo_.bar and http://test._foo are not ftp://test_.foo.bar is okay, but ftp://test.fo_o is not mailto:email@_test.foo.bar is okay, but mailto:email@_test.foo is not .

www._test.foo.bar is okay, but www._test.foo is not

http://te_st.foo.bar is okay, as is http://test.foo_.bar.foo

But http://te_st.foo, http://test.foo_.bar and http://test._foo are not

ftp://test_.foo.bar is okay, but ftp://test.fo_o is not

email@_test.foo.bar is okay, but mailto:email@_test.foo is not

```````````````````````````````` Domain names that contain invalid characters (not AlphaNumberic, -, _ or .) won't be matched ```````````````````````````````` example https://[your-domain]/api .

https://[your-domain]/api

```````````````````````````````` Domain names followed by ?, : or # instead of / are matched ```````````````````````````````` example https://github.com? https://github.com?a https://github.com#a https://github.com: https://github.com:443 .

https://github.com?

https://github.com?a

https://github.com#a

https://github.com:

https://github.com:443

```````````````````````````````` ### Unicode support Links with unicode characters in the path / query / fragment are matched and url encoded ```````````````````````````````` example http://abc.net/☃ http://abc.net?☃ http://abc.net#☃ http://abc.net/foo#☃ .

http://abc.net/☃

http://abc.net?☃

http://abc.net#☃

http://abc.net/foo#☃

```````````````````````````````` Unicode characters in the FQDN are matched and IDNA encoded ```````````````````````````````` example http://☃.net?☃ .

http://☃.net?☃

```````````````````````````````` Same goes for regular autolinks ```````````````````````````````` example .

http://abc.net/☃

http://abc.net?☃

http://abc.net#☃

http://abc.net/foo#☃

```````````````````````````````` ```````````````````````````````` example .

http://☃.net?☃

```````````````````````````````` It also complies with CommonMark's vision of priority. This will therefore be seen as an autolink and not as code inline. ```````````````````````````````` example ` .

http://foö.bar.`baz`

````````````````````````````````