Skip to content

This lib applies IDN #2

Description

@AlexWayfer

Hello.

I had problems with IDN, how to convert xn- like domains to their original (appealing) look, solved it in the hard way.

And then I wanted to highlight some parts, via your lib, but it breaks my domains back to IDN!

console.debug(urlhighlight({ url: 'https://дом.рф/' }))
<span class="url-protocol">https:</span><span class="url-protocol-delimiter">//</span><span class="url-host">xn--d1aqf.xn--p1ai</span>

I saw you use document.createElement('a'), I believe it affects URL in this way. Can we avoid this? Or make an alternative approach?

Also I can't apply the IDN decode to the host after the highlighting.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions