Page MenuHomePhabricator

Add option for absolute URLs to action=parse
Open, LowPublicFeature


When using action=parse to get HTML of a page, all links are relative, e.g.


Some people (see e.g. seem to want absolute URLs in links instead:

I think it would be useful if there was an option for action=parse to make all links absolute (or, alternatively, protocol-relative).

Version: 1.20.x
Severity: enhancement

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 12:45 AM
bzimport set Reference to bz40128.
bzimport added a subscriber: Unknown Object (MLST).

Avoid protocol-relative links -- these tend to turn into awkward things like "file://" or "ms-appx://" or something when including HTML into an app's webview.

Case use: mirror a wiki page on an applicative intranet. The links to edit works fine, but images won't show.

10 years ago, as a workaround in such situations, there were the possibility to put several base href, before and after the content with the IE and Opera, but now the browsers follow the recommendation and take in consideration only the first href and the first target value encountered.

Change 724186 had a related patch set uploaded (by Jforrester; author: Jforrester):

[mediawiki/core@master] Follow-up d334de9: Add makeurlsabsolute option to action=parse

Aklapper changed the subtype of this task from "Task" to "Feature Request".Feb 4 2022, 11:14 AM
Aklapper removed a subscriber: wikibugs-l-list.