mirror of
https://github.com/erusev/parsedown.git
synced 2023-08-10 21:13:06 +03:00
Better autolinks
This doesn't follow gfm spec yet, work lifted from my code over
at
8505e2737e/src/Parsers/GitHubFlavor/Inlines/AutoLink.php
Fixes #505
Fixes #717
This commit is contained in:
@@ -1,3 +1,9 @@
|
||||
<p>an autolink <a href="http://example.com">http://example.com</a></p>
|
||||
<p>inside of parentheses (<a href="http://example.com">http://example.com</a>)</p>
|
||||
<p>trailing slash <a href="http://example.com/">http://example.com/</a> and <a href="http://example.com/path/">http://example.com/path/</a></p>
|
||||
<p><a href="http://www.google.com/search?q=Markup+(business)">http://www.google.com/search?q=Markup+(business)</a></p>
|
||||
<p><a href="http://www.google.com/search?q=Markup+(business)">http://www.google.com/search?q=Markup+(business)</a>))</p>
|
||||
<p>(<a href="http://www.google.com/search?q=Markup+(business)">http://www.google.com/search?q=Markup+(business)</a>)</p>
|
||||
<p>(<a href="http://www.google.com/search?q=Markup+(business)">http://www.google.com/search?q=Markup+(business)</a></p>
|
||||
<p>trailing slash <a href="http://example.com/">http://example.com/</a> and <a href="http://example.com/path/">http://example.com/path/</a></p>
|
||||
<p>trailing paren <a href="https://www.owasp.org/index.php/Cross-site_Scripting_(XSS)">https://www.owasp.org/index.php/Cross-site_Scripting_(XSS)</a></p>
|
||||
<p>complex link <a href="http://elk.canda.biz/app/kibana#/discover?_g=()&_a=(columns:!(_source),index:'deve-*',interval:auto,query:(query_string:(analyze_wildcard:!t,query:'*')),sort:!('@timestamp',desc))">http://elk.canda.biz/app/kibana#/discover?_g=()&_a=(columns:!(_source),index:'deve-*',interval:auto,query:(query_string:(analyze_wildcard:!t,query:'*')),sort:!('@timestamp',desc))</a></p>
|
||||
@@ -2,4 +2,16 @@ an autolink http://example.com
|
||||
|
||||
inside of parentheses (http://example.com)
|
||||
|
||||
trailing slash http://example.com/ and http://example.com/path/
|
||||
http://www.google.com/search?q=Markup+(business)
|
||||
|
||||
http://www.google.com/search?q=Markup+(business)))
|
||||
|
||||
(http://www.google.com/search?q=Markup+(business))
|
||||
|
||||
(http://www.google.com/search?q=Markup+(business)
|
||||
|
||||
trailing slash http://example.com/ and http://example.com/path/
|
||||
|
||||
trailing paren https://www.owasp.org/index.php/Cross-site_Scripting_(XSS)
|
||||
|
||||
complex link http://elk.canda.biz/app/kibana#/discover?_g=()&_a=(columns:!(_source),index:'deve-*',interval:auto,query:(query_string:(analyze_wildcard:!t,query:'*')),sort:!('@timestamp',desc))
|
||||
Reference in New Issue
Block a user