forked from mastodon/mastodon
-
Notifications
You must be signed in to change notification settings - Fork 13
日本語交じりのURLの一部が自動リンクの対象にならない #57
Copy link
Copy link
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
問題は既知ですが調査結果を共有しておきます。
| good or bad | 入力内容 | 自動リンク処理結果 |
|---|---|---|
| 👍 | https://www.yahoo.co.jp/ | yahoo.co.jp/ |
| 👍 | http://日本語.jp/about | 日本語.jp/about |
| 👎 | http://dic.nicovideo.jp/a/アイドルマスター | dic.nicovideo.jp/a/アイドルマスター |
ホスト名に使われている日本語(おそらく非ASCII文字)はPunycodeで符号化されるらしく、有効です。
パス名に使われている日本語は無効になります。パス名を頭から読んでいって最初に非ASCII文字が出てきたところでURLとしての解釈が終わります。
Statusに投げられたプレーンテキストの処理にはtwitter-textのExtractorが使われているため、twitter-textの仕様だろうと思われます。
しかし、面白いことに(?)LinkCardは正常に取得できています。
FetchLinkCardServiceによれば、LinkCardを生成する際のURL認識は正規表現で行われているようです。
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working