Skip to content

Exclude non-ASCII path or backslash in extended www autolink #384

@tats-u

Description

@tats-u

Related: #377

https://ドメイン名例.jp/を参照してください。

Should be "https://ドメイン名例.jp/を参照してください。" (<a href="https://xn--eckwd4c7cu47r2wf.jp/">https://ドメイン名例.jp/</a>を参照してください。).

> new URL("https://ドメイン名例.jp/例?q=例").toString()
'https://xn--eckwd4c7cu47r2wf.jp/%E4%BE%8B?q=%E4%BE%8B'

Note

"ドメイン例.jp" is equivalent to "example.jp" in Japanese language.

Warning

We should be careful of IDN homograph attack for user-generated Markdown.

If you copy an Unicode URL like above in the address bar of your browser, the path (after / after the domain) is escaped in Firefox and Chromium-based, and the Unicode domain become a puny code in Chromium-based.

This is offending mostly in Japanese and occasionally in Chinese and Korean.

Also, \ is converted to / if pasted to the address bar of your browser. It should be excluded, too.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions