mirror of
https://github.com/xoofx/markdig.git
synced 2026-02-03 21:36:36 +00:00
No-ascii characters should be supported in AutoLinkInline #278
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @OpportunityLiu on GitHub (Mar 7, 2019).
https://babelmark.github.io/?text=%3Chttp%3A%2F%2F%E2%98%83.net%3F%E2%98%83%3E
Input:
Expacted:
@OpportunityLiu commented on GitHub (Mar 7, 2019):
as well as AutoLink
https://babelmark.github.io/?text=http%3A%2F%2F%E2%98%83.net%3F%E2%98%83+https%3A%2F%2Fcommonmark.org%2F
@xoofx commented on GitHub (Mar 7, 2019):
Good catch, PR welcome!
@MihaZupan commented on GitHub (Mar 7, 2019):
I implemented the
IsValidDomainfunction according to the GFM spec.That said, it seems that even GFM parses domain names like
http://☃.net?☃into<a href="http://%E2%98%83.net?%E2%98%83" rel="nofollow">http://☃.net?☃</a>.@xoofx In reference to #252, should the test be changed from
alphanumeric charactersintois not ascii punctuation (with exceptions), as for example the snowman emoji falls under "other symbols", not alphanumerics?Also as far as encoding is concerned, do you prefer we encode such domain names using IDNA ("xn--") or percent escaped (the majority of other parsers seem to be using percent escaping, like Markdig does now)?
@OpportunityLiu commented on GitHub (Mar 8, 2019):
Although most of browsers could handle it, the correct result is
<a href="http://xn--n3h.net?%E2%98%83">http://☃.net?☃</a>https://en.wikipedia.org/wiki/Punycode
@MihaZupan commented on GitHub (Mar 9, 2019):
I've implemented the changes needed for this, there is one minor problem tho.
IdnMappingclass is not available for netstandard1.1 or for portable.Currently I've put it in a
# ifregion, where those two versions revert to percent-escaping.@xoofx Would you be okay with non-consistent behavior for those legacy platforms in this case?