mwoffliner icon indicating copy to clipboard operation
mwoffliner copied to clipboard

Description (and other metadata like Title) must not contain escaped characters

Open kelson42 opened this issue 10 months ago • 6 comments

D&D description is not correct, see below

@kelson42 cloned issue kiwix/kiwix-android#4087 on 2024-11-17:

Screenshot: Image

kelson42 avatar Feb 16 '25 15:02 kelson42

@kelson42 commented on 2024-11-19:

Probably a problem with MWoffliner

kelson42 avatar Feb 16 '25 15:02 kelson42

@MohitMaliFtechiz commented on 2024-11-27:

@kelson42 I don't know if it is an MWoffiner problem or not as the description has the HTML entry in it. But It is a Kiwix app problem the description is "D&D Wiki" which has the HTML entry. But Kiwix is not properly decoding the HTML entries before setting it to the textView. I have fixed this issue in https://github.com/kiwix/kiwix-android/pull/4111.

kelson42 avatar Feb 16 '25 15:02 kelson42

@kelson42 commented on 2024-11-27:

@MohitMaliFtechiz Why should Kiwix decode HTML there? If someone put a png there, you want also to decode the png?

kelson42 avatar Feb 16 '25 15:02 kelson42

@MohitMaliFtechiz commented on 2024-11-28:

@kelson42 No, we don't want to decode the png in the Kiwix. The problem is on MWoffliner as it is puting the HTML in the description, but at least Kiwix should decode the HTML for the title and description if any comes due to this type of bug to avoid this type of visual error.

kelson42 avatar Feb 16 '25 15:02 kelson42

@kelson42 commented on 2024-11-28:

@MohitMaliFtechiz No, bug should be fixed at the right place. Fixing problems at the wrong place is the best way to create strange behaviours in edge cases and future bugs.

kelson42 avatar Feb 16 '25 15:02 kelson42

Note that in the mean time (until this issue get fixed) this ZIM title has been fixed manually (i.e. set as recipe argument). Do not consider that the fact it is now OK in the ZIM means that issue is gone, issue still needs to be fixed. We probably need to unescape the title which is retrieved from Mediawiki metadata.

benoit74 avatar Feb 18 '25 13:02 benoit74

Hi, I’ve been trying to reproduce this issue but I’m a bit confused. When I generate a ZIM from D&D Wiki and open it in Kiwix, I actually see the title and description displayed properly . Because of that, I’m not sure if I’m looking in the right place or if I’ve misunderstood the exact scenario where the escaped characters appear. Image

ziaddevv avatar Sep 05 '25 23:09 ziaddevv

Can you please:

  • share the command you've used to generate the ZIM
  • share the result of zimdump show --ns M --url Title -- <yourzimfile.zim> and zimdump show --ns M --url Description -- <yourzimfile.zim>

It is possible issue has been fixed by other changes, we've made quite heavy ones since February. Just confirming the issue is solved is a great help ^^

benoit74 avatar Sep 06 '25 07:09 benoit74

the Command I've used

mwoffliner -- --mwUrl=https://www.dandwiki.com [email protected] --articleList="Maps" --format=maxi --customZimTitle="Test" --filenamePrefix=dnd_test Please notify me if my command is wrong , it is weird that no metadata found

Image
  • also I think I've faced this issue https://github.com/openzim/mwoffliner/issues/2206 while generating some zim files

ziaddevv avatar Sep 06 '25 10:09 ziaddevv

any updates ?

ziaddevv avatar Sep 08 '25 04:09 ziaddevv

any updates ?

I don't work all days on mwoffliner maintenance, especially not during weekends, and usually need time to recover from last week and weekend activity on Monday.

Please notify me if my command is wrong , it is weird that no metadata found

Do you confirm you are running from mwoffliner dev version (logs should say Starting mwoffliner v1.16.1-dev0...) and your zimdump / libzim are recent (you can find them with zimdump --version ; latest zimdump version is 3.6.0, based on libzim 9.3.0, not sure which minimal versions you need but pretty sure an old ones might have troubles) ?

Also do not pass --customZimTitle="Test" since this issue is all about wrong encoding of title and description automatically retrieved from mediawiki instance.

benoit74 avatar Sep 08 '25 08:09 benoit74

thanks for the clarification. You were right ,I was using an old version of zimdump.

Now with the updated zim-tools 3.6.0 (libzim 9.3.0), I retried without --customZimTitle and got the expected metadata

zimdump show --ns M --url Title -- out/dnd_test_2025-09.zim D&D Wiki zimdump show --ns M --url Description -- out/dnd_test_2025-09.zim From D&D Wiki

ziaddevv avatar Sep 08 '25 09:09 ziaddevv

It looks like the problem might not have been in mwoffliner itself, or it may have already been resolved.

ziaddevv avatar Sep 08 '25 09:09 ziaddevv

Let's consider this has already been solved. Thank you !

benoit74 avatar Sep 08 '25 10:09 benoit74