As a reader, I want to see the most important part of a page preview in bold so that I know what the article is about
When users highlight a hovercard, display the first instance of bolded text appearing within the article.
(Note: still some issues with this, but simplest solution atm)
bold Phineas P. Gage as seen in
Background from original task description
The mechanism for generating the hovercard and displaying the article title in bold relies on the simplistic assumption that the article title is contained verbatim in the text extracted from the article intro. Consequently, it fails to highlight the article topic when this assumption is not true.
Some examples from dewiki (all picked from this page, where they can be tested by hovering over the corresponding link with hovercards enabled):
- https://de.wikipedia.org/wiki/J%C3%BClich-Klevischer_Erbfolgestreit (This last example represents a case that is frequent in German and some other languages, whose grammar requires declension of the article title when used as the subject of the first sentence. Another such example would be https://de.wikipedia.org/wiki/Amerikanischer_Unabh%C3%A4ngigkeitskrieg .)
The Russian Wikipedia seems to have a naming convention where many or most biographical articles are named "[[surname, first name]]", but the first sentence contains the subject's name in the usual form "first name surname" (e.g. Obama, Barack). So this problem will be very frequent there (indeed it appears to occur in 7 out of the 9 ruwiki screenshots someone posted for different reasons at T115817#2244421).
A solution would be to instead preserve the existing bold formatting, where the article's editors should already have taken of all those special cases, language-specific issues, local naming conventions etc.