Seems like it is a template that trigger the behavior.
w:nn:Kjartan Fløgstad
Template used: https://nn.wikipedia.org/wiki/Mal:Fødd
jeblad | |
May 19 2020, 9:32 PM |
F31833395: Screen Shot 2020-05-19 at 5.08.05 PM.png | |
May 20 2020, 12:08 AM |
F31833284: screenshot-preview-2020-05-19.png | |
May 19 2020, 9:32 PM |
Seems like it is a template that trigger the behavior.
Template used: https://nn.wikipedia.org/wiki/Mal:Fødd
Removing Wikipedia-Preview (see its description) and adding Page-Previews.
Page content is:
'''Kjartan Fløgstad''' {{fødd|7. juni|1944|Fløgstad, Kjartan}} er ein norsk forfattar fødd i [[industristad]]en [[Sauda]] i [[Rogaland]]. Han har skrive [[dikt]], [[roman]]ar og [[sakprosa]].
Summaries are generated by the page content service but this looks like an issue with the article?
I see the source text in the edit mode too:
Same in Parsoid output: https://nn.wikipedia.org/api/rest_v1/page/html/Kjartan_Fl%C3%B8gstad/3214441. Well, seeing it in VE was a big hint already. I suspect something related to the fødd template, most likely the 3rd parameter. If I remove the 3rd parameter then the problem goes away: with the 3rd parameter --> without. The Parsoid team can figure this out better.
{{fødd|7. juni|1944|Fløgstad, Kjartan}} expands to
<span>fødd [[7. juni]] [[1944]]</span>[[kategori:fødde den 7. juni]][[kategori:fødde i 1944]] {{DEFAULTSORT:Fløgstad, Kjartan}}
So, the newline break after the defaultsort causes {{fødd|7. juni|1944|Fløgstad, Kjartan}} er ... to split right before er ... which now renders as a <pre>..</pre>. Without the 3rd parameter, the defaultsort line is not there and so the problem doesn't show up.
I think in the legacy / core parser, category / and other metadata lines are just completely deleted and so the newlines disappear. This is somewhat of a known edge case. We'll see what we can do about it. But a temporary ugly workround is to break the line in source after the template call like this:
'''Kjartan Fløgstad''' {{fødd|7. juni|1944|Fløgstad, Kjartan}} er ein norsk forfattar fødd i [[industristad]]en [[Sauda]] i [[Rogaland]]. Han har skrive [[dikt]], [[roman]]ar og [[sakprosa]].
Well, looks like it is not entirely that: https://nn.wikipedia.org/wiki/Brukar:SSastry_(WMF)/Sandbox shows that there is something else going on with that template because unlike what I said there, when I explicit add the defaultsort line there, it behaves differently. Time to look at the template source.
I cannot tell immediately. Will have to investigate more. This looks like some edge case for sure.
Parsoid effectively is seeing a\n b which is the wikitext behavior to render lines starting with whitespace in pre tags. So, in that example b renders as <pre>b</pre>
There is no newline in the code, so this must happen during expansion outside what is visible for the editors.
The community has chosen to move the parenthesis out of the template and into wikitext. That makes the problem go away. It still should be fixed somehow, but it is a quick-fix and solves the problem at nnwiki.
Templates with these problems are w:nn:Mal:Levde, w:nn:Mal:Levde-lua, w:nn:Mal:Fødd, w:nn:Mal:Fødd-lua and w:nn:Mal:Død