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:

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 (Russian) are processed in a similar way.

Perhaps because there is a comma in the link?

2개의 좋아요

Same issue with ASCII-only titles containing commas:

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는 휴리스틱(heuristic)을 사용하므로 절대 100%의 확신을 보장할 수 없습니다(99.99%도 100%와 같지 않으므로) => 링크 경계를 강제하기 위해 특정 마커(현재는 <..>)가 필요합니다.
  • 사용자의 원박스(onebox) 역시 켜기/끄기를 강제하기 위해 특정 마커가 필요합니다.

즉: 두 독립적인 처리 모드가 있으므로 => 정의하기 위해 두 개의 독립적인 마커/플래그가 필요합니다.

현재는 두 가지 모드에 대해 단일 마커만 사용하고 있습니다. 이는 논리적 충돌입니다. 제 프로젝트에서는 다음과 같은 방식으로 문제를 해결했습니다:

  1. 자동 링크(<...> - 이 마크업)에 링크 변환기를 적용하도록 허용했습니다.
  2. 편집기 옵션에 “링크 확장 비활성화” 체크박스를 추가했습니다(각 게시물마다 적용)

완벽하지는 않지만 제게는 괜찮은 해결책입니다. 사용자의 경우를 위해 두 번째 마크업/플래그를 추가하는 더 나은 방법을 생각해 보실 수 있을 것입니다.

3개의 좋아요