Alex Kocharin
10 years ago
4 changed files with 93 additions and 8 deletions
@ -0,0 +1,66 @@ |
|||
|
|||
Encode link destination, decode text inside it: |
|||
|
|||
. |
|||
<http://example.com/α%CE%B2γ%CE%B4> |
|||
. |
|||
<p><a href="http://example.com/%CE%B1%CE%B2%CE%B3%CE%B4">http://example.com/αβγδ</a></p> |
|||
. |
|||
|
|||
. |
|||
[foo](http://example.com/α%CE%B2γ%CE%B4) |
|||
. |
|||
<p><a href="http://example.com/%CE%B1%CE%B2%CE%B3%CE%B4">foo</a></p> |
|||
. |
|||
|
|||
Should decode punycode: |
|||
|
|||
. |
|||
<http://xn--n3h.net/> |
|||
. |
|||
<p><a href="http://xn--n3h.net/">http://☃.net/</a></p> |
|||
. |
|||
|
|||
. |
|||
<http://☃.net/> |
|||
. |
|||
<p><a href="http://xn--n3h.net/">http://☃.net/</a></p> |
|||
. |
|||
|
|||
Invalid punycode: |
|||
|
|||
. |
|||
<http://xn--xn.com/> |
|||
. |
|||
<p><a href="http://xn--xn.com/">http://xn–xn.com/</a></p> |
|||
. |
|||
|
|||
Invalid punycode (non-ascii): |
|||
|
|||
. |
|||
<http://xn--γ.com/> |
|||
. |
|||
<p><a href="http://xn--xn---emd.com/">http://xn–γ.com/</a></p> |
|||
. |
|||
|
|||
Should auto-add protocol to autolinks: |
|||
|
|||
. |
|||
test google.com foo |
|||
. |
|||
<p>test <a href="http://google.com">google.com</a> foo</p> |
|||
. |
|||
|
|||
Should support IDN in autolinks: |
|||
|
|||
. |
|||
test http://xn--n3h.net/ foo |
|||
. |
|||
<p>test <a href="http://xn--n3h.net/">http://☃.net/</a> foo</p> |
|||
. |
|||
|
|||
. |
|||
test http://☃.net/ foo |
|||
. |
|||
<p>test <a href="http://xn--n3h.net/">http://☃.net/</a> foo</p> |
|||
. |
Loading…
Reference in new issue