Page MenuHomePhabricator

Investigate what to do with WikiLinkFixer now that Parsoid supports red links
Open, Needs TriagePublic

Description

Verify Parsoid link support works for us, then see if we can remove WikiLinkFixer.

We might need to start tracking HTML versions, since old HTML still needs to be fixed. Also, we need to request https://www.mediawiki.org/wiki/Specs/HTML/1.5.0 or later (currently 1.2.1).

For the relative path issue, we could start using BaseHrefFixer for all content.

Related Objects

View Standalone Graph
This task is connected to more than 200 other tasks. Only direct parents and subtasks are shown here. Use View Standalone Graph to show more of the graph.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJun 21 2017, 6:08 PM
Restricted Application added a project: Collaboration-Team-Triage. · View Herald TranscriptJun 21 2017, 6:08 PM

What is the relative path issue? And, is there a bug for that?

@ssastry It's not a bug per se, but basically Parsoid uses relative links starting with .:

E.g.

<!DOCTYPE html>
<html prefix="dc: http://purl.org/dc/terms/ mw: http://mediawiki.org/rdf/">
<head prefix="mwr: http://en.wikipedia.org/wiki/Special:Redirect/">
	<meta charset="utf-8">
	<meta content="0" property="mw:pageNamespace">
	<meta content="1.4.0" property="mw:html:version">
	<link href="//en.wikipedia.org/wiki/Earth/Foo" rel="dc:isVersionOf">
	<title></title>
	<base href="//en.wikipedia.org/wiki/">
	<link href="//en.wikipedia.org/w/load.php?modules=mediawiki.legacy.commonPrint%2Cshared%7Cmediawiki.skinning.content.parsoid%7Cmediawiki.skinning.interface%7Cskins.vector.styles%7Csite.styles%7Cext.cite.style%7Cmediawiki.page.gallery.styles&amp;only=styles&amp;skin=vector" rel="stylesheet">
</head>
<body class="mw-content-ltr sitedir-ltr ltr mw-body-content parsoid-body mediawiki mw-parser-output" dir="ltr" id="mwAA" lang="en">
	<p id="mwAQ"><a href="./Earth/Bar" id="mwAg" rel="mw:WikiLink" title="Earth/Bar">Earth/Bar</a></p>
</body>
</html>

This is correct, since there is a valid <base href>. But to use that, we'd have to either:

  • Inject it into the head, above the normal Flow scope (which might cause issues with unrelated content e.g. header/sidebar/footer). Don't know if we tried this, though, it might work.
  • Do our own base href fix (what we currently do).

If Parsoid used URLs starting with / we wouldn't need to do anything here.

Yes, hrefs in Parsoid HTML have to be resolved (absolutized) using the base href before you can use them in other contexts. We need to do this in VE too, to prevent URLs from breaking when the path is /w/index.php?... instead of /wiki/Pagename.

Restricted Application added a project: Growth-Team. · View Herald TranscriptSep 2 2018, 11:24 PM