deltachat / message-parser

Parsing of Links, Email adresses, simple text formatting (markdown subset), user mentions, hashtags and more in DeltaChat messages.
https://deltachat.github.io/message-parser/
Other
12 stars 2 forks source link

ipv6 address is mistaken for containing unicode / puny-code-domains #35

Closed Simon-Laux closed 1 year ago

Simon-Laux commented 1 year ago

input:

http://[2001:0db8:85a3:08d3::0370:7344]:8080/

expected output:

[
    {
        "t": "Link",
        "c": {
            "destination": {
                "target": "http://[2001:0db8:85a3:08d3::0370:7344]:8080/",
                "hostname": "[2001:0db8:85a3:08d3::0370:7344]",
                "punycode": null
            }
        }
    }
]

actual output

[
    {
        "t": "Link",
        "c": {
            "destination": {
                "target": "http://[2001:0db8:85a3:08d3::0370:7344]:8080/",
                "hostname": "[2001:0db8:85a3:08d3::0370:7344]",
                "punycode": {
                    "original_hostname": "[2001:0db8:85a3:08d3::0370:7344]",
                    "ascii_hostname": "xn--[2001:0db8:85a3:08d3::0370:7344]-",
                    "punycode_encoded_url": "http://xn--[2001:0db8:85a3:08d3::0370:7344]-:8080/"
                }
            }
        }
    }
]