Page MenuHomePhabricator

Page title displays HTML entity code ' rather than the actual apostrophe character
Closed, ResolvedPublic


I've only noticed this on one page so far but on, an author page uses a typographic apostrophe rather than a straight apostrophe and the <title> tag in the HTML renders his name as "G. R. O&#39;Reilly" rather than "G. R. O'Reilly". See and view the source to find "<title>G. R. O&amp;#39;Reilly - Wikisource, the free online library</title>"

Event Timeline

Koavf created this task.Oct 13 2017, 8:23 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptOct 13 2017, 8:23 AM
Aklapper renamed this task from Page titles are displaying HTML entity codes rather than the actual character to Page title displays HTML entity code &#39; rather than the actual apostrophe character.Oct 13 2017, 10:33 AM
Aklapper added a project: MediaWiki-Parser.

I just tried creating Portal:Sandbox/"&' on English Wikisource: all three characters " & and ' are affected.

I guess that the encoding of these characters done by {{PAGENAME}} is interacting with some over-zealous escape script somewhere.

Okay so specifically uses {{PAGENAME}} in order to remove the namespace prefix in the title, which I guess will need to be removed to resolve the issue. I wonder if we can remove the namespace prefix without encoding these characters.

Okay, I found that #titleparts undoes the encoding that {{PAGENAME}} does, so I placed {{#titleparts:{{PAGENAME}}}} in MediaWiki:Pagetitle and that seems to have done the trick.

beleg_tal closed this task as Resolved.Sep 24 2019, 12:16 AM