Wikipedia oneboxing of articles containing unusual characters in the URL

If you link to Wikipedia by reference, then the link works.

Филиппов, Михаил Михайлович (учёный)

If I copy the address from the browser line:

Филиппов — Википедия,%D0%9C%D0%B8%D1%85%D0%B0%D0%B8%D0%BB%D0%9C%D0%B8%D1%85%D0%B0%D0%B9%D0%BB%D0%BE%D0%B2%D0%B8%D1%87_(%D1%83%D1%87%D1%91%D0%BD%D1%8B%D0%B9)

Original address

https://ru.wikipedia.org/wiki/%D0%A4%D0%B8%D0%BB%D0%B8%D0%BF%D0%BF%D0%BE%D0%B2,_%D0%9C%D0%B8%D1%85%D0%B0%D0%B8%D0%BB_%D0%9C%D0%B8%D1%85%D0%B0%D0%B9%D0%BB%D0%BE%D0%B2%D0%B8%D1%87_(%D1%83%D1%87%D1%91%D0%BD%D1%8B%D0%B9)

Perhaps the error is not common, but in the last 2 days, users noticed that some Wikipedia articles (Russians) are processed in a similar way.

Perhaps because there is a comma in the link?

「いいね!」 2

Same issue with ASCII-only titles containing commas:

I - Wikipedia,Robot(film)

https://en.wikipedia.org/wiki/I,_Robot_(film)

「いいね!」 3

The autolinker avoids certain extreme edge cases by design, last time I mentioned this to @Vitaly the general recommendation is to use <.......> here for terrible edge cases which allows you to workaround this. Does not work with one box though.

Current workaround is to swap , with %2c

https://ru.wikipedia.org/wiki/%D0%A4%D0%B8%D0%BB%D0%B8%D0%BF%D0%BF%D0%BE%D0%B2%2c_%D0%9C%D0%B8%D1%85%D0%B0%D0%B8%D0%BB_%D0%9C%D0%B8%D1%85%D0%B0%D0%B9%D0%BB%D0%BE%D0%B2%D0%B8%D1%87_(%D1%83%D1%87%D1%91%D0%BD%D1%8B%D0%B9)

「いいね!」 2

Also weird when the Wikipedia URL ends in an exclamation point.

https://en.wikipedia.org/wiki/Top_Secret!

You have to URL encode that as well…

https://en.wikipedia.org/wiki/Top_Secret%21

「いいね!」 1
  • linkify-it はヒューリスティックを使用するため、100% の信頼性を保証することは決してできません (99.99% でも 100% ではありません) =\u003e リンクの境界を強制するには、何らかのマーカー (現在は \u003c..\u003e) が必要です。
  • あなたの onebox にも、オン/オフを強制するためのマーカーが必要です。

したがって、2 つの独立した処理モードがあります =\u003e 定義するには 2 つの独立したマーカー/フラグが必要です。

現在、2 つのモードに対して単一のマーカーしかありません。これは論理的な衝突です。私のプロジェクトでは、この問題を次のように解決しました。

  1. オートリンク (\u003c...\u003e - このマークアップ) にリンクコンバーターを適用できるようにしました。
  2. エディターオプションにチェックボックス「リンク展開を無効にする」(各投稿ごと) を追加しました。

理想的ではありませんが、私にとっては問題ありません。あなたの場合は、2 番目のマークアップ/フラグを追加するためのより良い方法を考案できるかもしれません。

「いいね!」 3