Page MenuHomePhabricator

Flow: display of templates different from display in wikitext
Open, NormalPublic

Event Timeline

Sunpriat created this task.May 31 2015, 7:37 AM
Sunpriat raised the priority of this task from to Needs Triage.
Sunpriat updated the task description. (Show Details)
Sunpriat added a subscriber: Sunpriat.
Restricted Application added a project: Collaboration-Team-Triage. · View Herald TranscriptMay 31 2015, 7:37 AM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
DannyH triaged this task as Normal priority.Jun 2 2015, 4:50 PM
DannyH added a subscriber: DannyH.

This may be related to T99856 -- we'll figure it out. Thanks for reporting it.

Could this be a template invalidation bug? I edited the description and now it renders fine.

I believe there's a known bug about how when you use a template, and the template is edited, the post/header isn't automatically rerendered.

Sunpriat added a comment.EditedJun 10 2015, 9:10 PM

@Catrope
rerender it is T59991
No currently it is not fine. See those areas where there is a scroll bar, try to use it until the end. The template works on the mechanisms that understand wikitext parser. To complicate or modify it (or any other) because of Flow no one will.

@Catrope
rerender it is T59991

Thanks!

No currently it is not fine. See those areas where there is a scroll bar, try to use it until the end. The template works on the mechanisms that understand wikitext parser. To complicate or modify it (or any other) because of Flov no one will.

You're right, below the fold it's still broken. Let me see if that's a Parsoid bug.

You're right, below the fold it's still broken. Let me see if that's a Parsoid bug.

Yup, comparing https://ru.wikipedia.org/wiki/%D0%A3%D1%87%D0%B0%D1%81%D1%82%D0%BD%D0%B8%D0%BA:Roan_Kattouw_%28WMF%29/Sandbox with https://rest.wikimedia.org/ru.wikipedia.org/v1/page/html/%D0%A3%D1%87%D0%B0%D1%81%D1%82%D0%BD%D0%B8%D0%BA:Roan_Kattouw_(WMF)%2FSandbox it seems to be a bug in Parsoid. I'll try to figure out what the bug is exactly.

It looks like the template in question generates some pretty broken HTML, and the PHP parser magically cleans it up whereas Parsoid takes it more literally. I found the following snippet in the expansion of {{Актуально}} (by using Special:ExpandTemplates):

<div style="max-height:200px;overflow:auto">
<li>(<span style="color:blue">обсуждение</span>) [[Википедия:Обсуждение правил/Поправки к ВП:Именование статей (воинские формирования)|Поправки к ВП:Именование статей (воинские формирования)]]

<li>(<span style="color:blue">обсуждение</span>) [[Википедия:Обсуждение правил/Руководство по написанию статей о текущих событиях|Руководство по написанию статей о текущих событиях]]

<li>(<span style="color:blue">обсуждение</span>) [[Википедия:Обсуждение правил/Дополнения в КЗП|Дополнения в КЗП]]

<li>(<span style="color:blue">обсуждение</span>) [[Википедия:Обсуждение правил/Источники к ВП:Имена|Источники к ВП:Имена]]

<li>(<span style="color:blue">обсуждение</span>) [[Википедия:Обсуждение правил/Статус ВП:ГН|Статус ВП:ГН]]

<li>(<span style="color:#A30">итог</span>) [[Википедия:Обсуждение правил/Поправки к ВП:Именование статей/Спортивные команды|Поправки к ВП:Именование статей/Спортивные команды]]

<li>(<span style="color:blue">обсуждение</span>) [[Википедия:Обсуждение правил/Поправки в ВП:СПОРТСМЕНЫ|Поправки в ВП:СПОРТСМЕНЫ]]



<li>(<span style="color:blue">обсуждение</span>) [[Википедия:Обсуждение правил/Критерии значимости шахматистов|Критерии значимости шахматистов]]













<li>(<span style="color:blue">обсуждение</span>) [[Википедия:Обсуждение правил/В культуре|Руководство по написанию разделов «Тема в культуре»]]



























<li>(<span style="color:#3A0">предв. итог</span>) [[Википедия:Обсуждение правил/Критерии значимости аниме и манги 2|Аниме и манга 2]]



















































<li>(<span style="color:#3A0">предв. итог</span>) [[Википедия:Обсуждение правил/Новая редакция ВП:ОРИСС|Новая редакция ВП:ОРИСС (продолжение)]]</div>

So that's

  • <li>s directly inside a <div> without a wrapping <ul>
  • Unclosed <li>s
  • Lots of newlines (the longest sequence is 52 newlines)

For some reason, the PHP parser appears to ignore double newlines in this case, but under normal circumstances a double newline generates a paragraph break. Parsoid doesn't ignore double newlines here, and so it generates paragraph breaks as normal, which results in broken display.

I'll see if I can chase down where exactly in the sub-templates and sub-sub-templates this stuff comes from.

What's worse, it appears this was deliberate on the part of the template authors. Apparently they were aware of the fact that the PHP parser swallows blank lines in unclosed <li>s:

<!--
NB: ниже использован тег <li> без пары </li> (вместо викикода "*"), чтобы он "проглатывал" пустые строки,
    остающиеся от неотображаемых (hide=1) строк
    -->