mwoffliner icon indicating copy to clipboard operation
mwoffliner copied to clipboard

Hatnote is erroneously moved to second paragraph along with infobox

Open Jaifroid opened this issue 6 years ago • 20 comments

Viewing the article "Peripheral neuropathy" in wikipedia_en_medicine_novid_2018-01.zim, the hatnote "Not to be confused with..." has been shifted to the second paragraph along with the infobox (see first screenshot). On Wikipedia mobile view this line is in the correct place just below the page title. I'm guessing this is a mwoffliner issue, as it's in the HTML that comes out of the ZIM.

It's a general issue, because it also occurs with the "Melatonin" article (see second screenshot).

image

image

Jaifroid avatar Jan 11 '18 15:01 Jaifroid

@subbuss If I look in Parsoid output, the hatnot is put in the middle (like in the ZIM) of the lead section https://en.wikipedia.org/api/rest_v1/page/mobile-sections/Melatonin. But this is not how the online version behaves, like @Jaifroid reported. Looks strange for me. Do we have a bug in Parsoid here? Or do we need to make special handling?

kelson42 avatar Jan 11 '18 16:01 kelson42

https://en.wikipedia.org/api/rest_v1/page/html/Peripheral_neuropathy shows it at the right place?

subbuss avatar Jan 11 '18 16:01 subbuss

@subbuss for the desktop version yes, but not for the mobile. See https://en.wikipedia.org/api/rest_v1/page/mobile-sections/Peripheral_neuropathy

kelson42 avatar Jan 11 '18 16:01 kelson42

For the currently deployed Wikimedia REST API mobile-sections endpoint, moving the initial paragraph of an article up top, even above hatnotes, is actually the intended behavior. This was driven by a design decision for the Wikipedia Android app, which was the endpoint's initial consumer.

In the next-generation (not-yet-active) version of mobile-sections the hatnote is broken out into the response json structure greater client flexibility.

mdholloway avatar Jan 11 '18 18:01 mdholloway

@mdholloway thx. So basically in the future version the hatnote will be removed from article HTML and will be only available as metadata (like it is already available currently)?

kelson42 avatar Jan 11 '18 19:01 kelson42

@kelson42 Yes, that's correct. Hatnotes will be broken out like this: https://gist.github.com/mdholloway/5010f7c4f737cd3262288563d643240a#file-resp-txt-L27-L29

mdholloway avatar Jan 12 '18 17:01 mdholloway

Just to add that the same issue affects notes (in English Wikivoyage) of the type "For other places with the same name, see Paris (disambiguation)" (this is from the Paris article). However, this note isn't labelled "hatnote", it is inside a <dl> structure and it is identified with a CSS class of "noexcerpt". This is what the HTML looks like:

<dl>
  <dd>
    <span class="noexcerpt"><i>For other places with the same name, see 
      <a href="Paris_(disambiguation).html" title="Paris (disambiguation)">
      Paris (disambiguation)</a>.</i>
    </span>
  </dd>
</dl>

And this is the screenshot:

image

Jaifroid avatar Jan 13 '18 18:01 Jaifroid

Just a quick note to say this affects also French Wikipedia / WikiMed which has some "hatnote" equivalents which are rendered as <div class="homonymie" ...>. Screenshot shows one of these. It seems that whatever code moves the infoboxes down below the lead paragraph (in order to produce the mobile style) is accidentally but systematically moving hatnotes along with the infobox. Probably a regex that is not specific enough.

image

Jaifroid avatar Feb 28 '18 07:02 Jaifroid

@kelson42 I think this one gets the Parsoid tag, since my reading is that there are no plans to change mwoffliner based on the current Parsoid output. (It looks like that would be an awkward hack to even try.)

bradyhunsaker avatar Jul 08 '18 18:07 bradyhunsaker

Just a quick update to note that I'm still getting this error on recent ZIMs. Example below is from wikipedia_en_maths_novid_2018-06.zim, article "Series (mathematics)". I realize we may well be waiting on a change in Parsoid, but it would be good to prevent this issue from being put on the back burner...

image

Jaifroid avatar Sep 17 '18 21:09 Jaifroid

Looks like hatnotes are completly removed now... Not sure if this is good or bad, but now this problem does not occur anymore.

kelson42 avatar Jul 22 '19 11:07 kelson42

It may not be labelled "hatnote", but in wikivoyage_en_all_novid_2019-07.zim (made very recently), we still have a similar problem:

image

Do you want me to make a new issue for it, @kelson42, or re-open this one?

Jaifroid avatar Jul 22 '19 11:07 Jaifroid

This issue 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.

stale[bot] avatar Oct 01 '19 08:10 stale[bot]

Just to say that this issue persists in wikipedia_en_all_maxi_2020-06.zim:

image

Jaifroid avatar Jul 19 '20 21:07 Jaifroid

This issue 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.

stale[bot] avatar Sep 18 '20 04:09 stale[bot]

This issue 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.

stale[bot] avatar Jan 02 '21 03:01 stale[bot]

Just to keep this alive, issue still persists. In Kiwix JS Windows / PWA, I currently reposition these misplaced hatnotes, redirects and other "not to be confused with" notes, though it's a little tricky because they're not always easy to identify programmatically, and I only test in English, Spanish, German, occasionally French...

image

Jaifroid avatar Jul 05 '21 13:07 Jaifroid

Bug is still there http://library.kiwix.org/wikipedia_en_medicine/A/Peripheral_neuropathy

kelson42 avatar Jul 20 '21 11:07 kelson42

Issue persists (also, the infobox is poorly rendered on desktop screen sizes. It should be right-aligned and thinner on large screens; on narrow screens it is not rendered on Wikipedia mobile view).

I try to fix these display issues in Kiwix JS Windows (see screenshot far bottom). I know it's hacky, and not really the reader's job, but it seems this issue can't be fixed in the ZIM, and won't be fixed by Parsoid either...

image

2021-09-19 (3)

Jaifroid avatar Sep 19 '21 22:09 Jaifroid

This issue 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.

stale[bot] avatar Mar 02 '22 08:03 stale[bot]