-
-
Notifications
You must be signed in to change notification settings - Fork 78
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
Title should be based on the DOM node <title> #605
Comments
@ISNIT0 as per kiwix/kiwix-js#475, |
Odd, the code seems like it always provides a title (even if it has to fallback to the articleId) |
@ISNIT0 , the underlying libzim code in most Kiwix clients fills in the title from the url if there is no title, so the error is masked. In Kiwix JS, we opted to put |
I've modified the logic now to read the (html stripped) title from Does this seem right? PR coming soon |
@ISNIT0 Have you verified it fixed the problem reported by Jaifrod. I hardly understand how the Parsoid API title should/could be different from the HTML one. Are you able to explain this? |
Weirdly, zimdump shows the titles are set, but KiwixJS still has the
|
@Jaifroid I don't remember the whole discussion with @mgautierfr but the conclusion was I think the format just takes the string from the URL in case there is not title... and the writer of the libzim considering this, never writes the title if this is the same as the URL. So, saying this, the question might be more: why you display it differently if the title from the title or the URL? |
The issue is that clients based on libzim transparently use the dirEntry's URL if the dirEntry's title is empty. In Kiwix JS we decided to add square brackets in such cases as a diagnostic tool. The square brackets are only added by Kiwix JS if the title is empty. The underlying problem is that mwoffliner (I presume) has not correctly added titles in such cases. "Laurel Highlands" does seem to have the correct title (no square brackets above, also no underscore, another telltale symptom that the URL has been used instead of title). I'm pinging @mossroy in case he can help to diagnose or corroborate, as I'm currently travelling for work. |
I confirm that. Here is more detail : In libzim, the In kiwix-js, we had to implement the exact same title/url fallback in the binary search (else some articles could not be found : kiwix/kiwix-js#440) BUT we did not implement it in the DirEntry class : only in the binary search where the bug was. And, when we display a matching article (in search results), and its title is empty, we display instead the URL inside square brackets. All this has been implemented in PR kiwix/kiwix-js#443. It might be discussed if we should implement the exact same fallback in DirEntry class of kiwix-js. I did not consider it as necessary so far, and don't like getter/setters that do such nasty things in my back. |
@ISNIT0 I reopen the ticket as this is not clear to me if the pb is fixed. Could you please upload somewhere the ZIM file of Wikivoyage you ave created with git master HEAD? |
Using the published Wikivoyage file from download.kiwix.org I'm seeing this:
It seems to me the published file is valid. It's odd to me that KiwixJS only shows the |
I'm closing the ticket, the whole discussion is going in a direction which has nothing to do with the original bug report. |
OK. Still, something is off, either in mwoffliner or in Kiwix JS. I'll investigate what's happening on the Kiwix JS end, and will open an issue there. |
Based on kiwix/kiwix-js#475 (comment)
AFAIK this was done properly before. We should also secure that if we have something like
<title>2<b>b</b></title>
then the<b>
will be removed.The text was updated successfully, but these errors were encountered: