-
-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't write image descriptions twice #1816
base: main
Are you sure you want to change the base?
Conversation
185b102
to
51c6946
Compare
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #1816 +/- ##
==========================================
+ Coverage 70.90% 70.97% +0.06%
==========================================
Files 23 23
Lines 2609 2615 +6
Branches 593 594 +1
==========================================
+ Hits 1850 1856 +6
Misses 653 653
Partials 106 106
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
@pavel-karatsiuba in a first place, before codin, understanding of the problem. why a few images suffer of this problem and other don't? I guess the bug ia not in the original dom? Pretyy sure there is a better way to solve it, once we fully undetstand what is going on. |
On the original Wikipedia page, I see other tags and it does not contains the description for the image, but only for the block. The easiest way is not to use the This is the HTML from API:
|
@pavel-karatsiuba Does our parser is adapted at all to parse the "figure" DOM element? Have you read https://www.mediawiki.org/wiki/Parsoid/Parser_Unification/Media_structure/FAQ/en ? |
I have read this document and see that our code is fit to described format. So I propose to remove the text which is placed after the |
@pavel-karatsiuba How do you explain the text is not displayed in duplicate on Wikipedia itself? The problem behind this is big. |
I don't understand, please explain. |
https://de.wikipedia.org/api/rest_v1/page/html/Nationalpark_Eifel
mwoffliner also has the same CSS rule. But mwoffliner uses the mobile version and API for the mobile version does not provide the To see the difference, you can compare the next pages in the browser: |
@pavel-karatsiuba Why you refer to https://de.wikipedia.org/api/rest_v1/page/mobile-sections/Nationalpark_Eifel ?! AFAIK MWoffliner does not use this API (this is the topic of #1664)! |
Sorry, I didn't know about the old and new versions of API. I thought that mobile-html and mobile-sections return the same data but with a different view. This is the ticket that described the same situation: https://phabricator.wikimedia.org/T291779 My PR is fixing only the current ticket. |
This pull request has been automatically marked as stale because it has not had recent activity. It will be now be reviewed manually. Thank you for your contributions. |
If the image contains the same description in the nearest DOM element then do not add an image description because it will be displayed twice.
Fix: #1536