Skip to content

Extract usable title from Parsoid HTML

Legoktm requested to merge title-fix into main

As noted in T324431, the <title> element can contain HTML markup if {{DISPLAYTITLE:...}} is used. The only other metadata field that contains the title is <link rel="dc:isVersionOf" href="...">.

Wikicode::title() now extracts the title from there, with the caveat that it's in URL form rather than human form.

The main impact of this was that sticking the title into a URL wouldn't work, causing functions like transform_to_wikitext() to error with HTTP 400.

Bug: T326490

Edited by Legoktm

Merge request reports