Page MenuHomePhabricator

Bizarre collision between index/style.css and incomplete table notation
Closed, ResolvedPublicBUG REPORT

Description

List of steps to reproduce (step by step, including full links if applicable):

  • Create a table spanning 2 or more pages of an index (typical behaviour is putting the {| and |} in the header/footer)
  • Set up an index/style.css page.

What happens?:
The table renders incorrectly on the Page: NS. (as text, not table)

There's a p HTML tag with the styles HTML tag inside, and the " {| " as plain text

What should have happened instead?:
The table should've render correctly

The styles HTML tag should've been at the top of the div.mw-parser-output, not inside a random p tag

Example:
https://es.wikisource.org/wiki/P%C3%A1gina:Vocabularios_y_nuevos_materiales_para_el_estudio_de_la_lengua_de_los_indios_Lic%C3%A1n-Antai.djvu/11

Event Timeline

T253072 strikes again!

Also, this is probably happening because the inserted <templatestyles /> extension tag leads to the parser failing to recognise the table-start wikimarkup since it is no longer at the beginning of the line. I'm not sure whether the p-wrapping plays a role in that or not. The same thing will be happening for all Page: pages, but only the table wikimarkup is sensitive to being at the very start of a line so that's the only case where you are likely to notice.

You can work around it by putting a {{np}} (on esWS; on enWS it'll be {{nopt}}) on the line before the {|.

@Inductiveload You may want to be aware of this issue as it relates to T215165.

Adding a newline after the TS in this concatenation is probably enough to fix this (modulo p-wrapping).

$wikitext = $indexTs->getIndexTemplateStyles( '.pagetext' );
$wikitext .= $this->header->getText() . "\n\n" . $this->body->getText() . $this->footer->getText();

T253072 strikes again!

Also, this is probably happening because the inserted <templatestyles /> extension tag leads to the parser failing to recognise the table-start wikimarkup since it is no longer at the beginning of the line. I'm not sure whether the p-wrapping plays a role in that or not. The same thing will be happening for all Page: pages, but only the table wikimarkup is sensitive to being at the very start of a line so that's the only case where you are likely to notice.

You can work around it by putting a {{np}} (on esWS; on enWS it'll be {{nopt}}) on the line before the {|.

@Inductiveload You may want to be aware of this issue as it relates to T215165.

Adding a newline after the TS in this concatenation is probably enough to fix this (modulo p-wrapping).

$wikitext = $indexTs->getIndexTemplateStyles( '.pagetext' );
$wikitext .= $this->header->getText() . "\n\n" . $this->body->getText() . $this->footer->getText();

Actually, this appears to affect headings, and unordered lists (the : markup that is generally used to offset text) also. :)

Actually, this appears to affect headings, and unordered lists (the : markup that is generally used to offset text) also. :)

Ah, right. We don't use these in the Page: namespace on enWS so I'd forgotten about them, but any wikimarkup that must be at the start of the line to be recognised will be affected by this.

Change 694340 had a related patch set uploaded (by Inductiveload; author: Inductiveload):

[mediawiki/extensions/ProofreadPage@master] Add newline after TemplateStyles in page header

https://gerrit.wikimedia.org/r/694340

Change 694340 merged by jenkins-bot:

[mediawiki/extensions/ProofreadPage@master] Add newline after TemplateStyles in page header

https://gerrit.wikimedia.org/r/694340