gnosygnu / xowa

xowa offline wiki application
Other
375 stars 41 forks source link

extra visual space in 'listen' #703

Closed desb42 closed 4 years ago

desb42 commented 4 years ago

I was looking at en.wikipedia.org/wiki/Poland for another reason and noticed this discrepancy poland3 In the first paragraph the word listen appears twice. xowa shows 'listen' as listen ) whereas mediawiki shows listen) That is, there seems to be an additional space

On investigating the page source, the difference between xowa and mediawiki (in this case) is a linefeed. That is mediawiki has the snippet

.ogg">listen</a></span>

whereas the equivalent in xowa is

.ogg">listen
</a></span>

I have tracked this down to the classfile Xoh_file_fmtr__basic.java Line 30 deliberately inserts a linefeed

private final    Bry_fmt fmtr_full_media = Bry_fmt.Auto("<a href=\"~{a_href}\" xowa_title=\"~{a_xowa_title}\">~{html}\n</a>");

removing that linefeed seems to cure this discrepancy

gnosygnu commented 4 years ago

Again, amazing eye for detail! I don't think I would have ever noticed that extra whitespace. Really appreciate the hunting down the cause too!

For reference, I generally added a bunch of extra whitespace (new-lines; spaces) so that the HTML would "line" up properly. I assumed that the whitespace would not affect the HTML, but it does in this case.

Anyway, fixed with your recommended commit above. Thanks!