Topic on Talk:Parsoid

Jump to navigation Jump to search

Pagebanner template at Wikivoyage

5
Summary by Whatamidoing (WMF)
Whatamidoing (WMF) (talkcontribs)

Hello,

I've noticed that voy:en:Template:Pagebanner has a strange behavior in the visual editor. Inspired by @SSastry (WMF)'s excellent explanation of the '''foo {{1x|'''a'''}} bar''' parsing problem, I wanted to ask if there might be something wrong/unbalanced about the template code.

The behavior that I see is that if the wikitext says:

{{pagebanner}}

First sentence


then the first sentence is treated as a complex transclusion of the two parts. See https://en.wikivoyage.org/wiki/Catalina_Island?veaction=edit as an example of this. However, if there is a blank line between the first sentence and the pagebanner template, then it is not treated as a complex transclusion, and the first line is (properly/as expected) separate from the template. What do you think is wrong here?

SSastry (WMF) (talkcontribs)

You are on the right track. :-)

The reason why Parsoid expands the scope of the template is because parts of its output is combined with that sentence to create a paragraph.

In this case, it seems to be because the pagebanner template uses the <indicator> extension and Parsoid seems to think that it should be wrapped in a paragraph. That is more likely a problem with Parsoid's interpretation of the <indicator> extension's output and we may be able to fix that. Can you file a bug for us? Thanks!

Glad you found the explanation useful.

SSastry (WMF) (talkcontribs)

There is another (un)related issue that Parsoid should fix as well. If you look at https://en.wikivoyage.org/api/rest_v1/page/html/Catalina_Island, you see that the banner is missing. This is another issue with Parsoid's handling of the indicator extension. This is likely to get addressed once Parsoid is ported with PHP and integrated with core.

Whatamidoing (WMF) (talkcontribs)

I filed one bug mentioning both, since it sounds like the second is a problem that will automagically disappear without requiring any specific effort. If you want them split, please reply here. I stopped watching this page after the Tidy/Remex change was completely wrapped up, but I am subscribed to this thread (and of course you are welcome to ping me in any conversation on any wiki).

SSastry (WMF) (talkcontribs)

Thanks! That bug report is good enough. We will split if required.