Page MenuHomePhabricator

The number of citation doesn't match when using `/api/rest_v1/page/mobile-sections/`
Open, LowPublicBUG REPORT

Description

Steps to Reproduce:

  1. When accessing the API, https://be.wikipedia.org/api/rest_v1/page/mobile-sections/%D0%9A%D0%B0%D1%86%D1%8F%D1%80%D1%8B%D0%BD%D0%B0_%D0%9C%D0%B5%D0%B4%D1%8B%D1%87%D1%8B
  2. It responses the first section text
<p><b>Кацярына Медычы</b><span class="mw-ref" id="cite_ref-pr_4-0"><a href="#cite_note-pr-4" style="counter-reset: mw-Ref 4;"><span class="mw-reflink-text">[4]</span></a></span> ...

Actual Results:

  1. the citation shows number [4]

Expected Results:

It should show [5], according to the web page https://be.wikipedia.org/wiki/%D0%9A%D0%B0%D1%86%D1%8F%D1%80%D1%8B%D0%BD%D0%B0_%D0%9C%D0%B5%D0%B4%D1%8B%D1%87%D1%8B

Event Timeline

hueitan created this task.May 24 2020, 6:14 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMay 24 2020, 6:14 PM

@hueitan: Assuming this task is about RESTBase-API / Mobile-Content-Service code project, hence adding that project tag so other people who don't know or don't care about team tags can also find this task when searching via projects. (Please set appropriate project tags when possible. Thanks!)

Mholloway added a subscriber: Mholloway.

Thanks for the project tags, @Aklapper. I'll remove RESTBase-API since this bug is almost certainly in the Mobile-Content-Service code.

LGoto triaged this task as Medium priority.May 27 2020, 3:40 PM
LGoto assigned this task to Jgiannelos.Jun 10 2020, 3:53 PM

I tried to reproduce locally to figure out what causes this issue. It looks like even calling Parsoid directly, the citation in response also shows number [4].

This html content is then consumed as is in the mobile-sections endpoint of mobileapps service.

bearND added a subscriber: bearND.

As mentioned above this comes from Parsoid.

The legacy parser has this additional reference as #4, which the Parsoid output doesn't have:

Katharina von Medici // FemBio Праверана 9 кастрычніка 2017.

Not sure where this came from. Adding the Parsoid team as a FYI to note the difference, not saying that the Parsoid output is wrong.

ssastry lowered the priority of this task from Medium to Low.Jun 23 2020, 4:54 PM
ssastry edited projects, added Cite; removed Mobile-Content-Service.
ssastry added a subscriber: ssastry.

That 4th reference on the page https://be.wikipedia.org/wiki/%D0%9A%D0%B0%D1%86%D1%8F%D1%80%D1%8B%D0%BD%D0%B0_%D0%9C%D0%B5%D0%B4%D1%8B%D1%87%D1%8B#cite_ref-_06651e4fdf929d6b_4-0 is a dangling reference. So, I would say the core Cite extension is buggy here. I am going to put this as a low priority edge case and not investigate this at this time.

Dangling references are inconsistently supported though. If it's in an image caption, ex. [[File:Test.png|Hi<ref>ho</ref>]], Parsoid will find it with $extApi->processHiddenHTMLInDataAttributes. So maybe this is another case that method should be handling.

Jgiannelos removed Jgiannelos as the assignee of this task.Wed, Jul 8, 3:41 PM
Jgiannelos added a subscriber: Jgiannelos.
Izno moved this task from Unsorted backlog to Defect backlog on the Cite board.Tue, Jul 21, 6:18 PM