API action=parse&prop=headhtml returns more than just the <head> element: Fix documentation
Open, Needs TriagePublic

Description

action=parse&prop=headhtml is supposed to give "parsed <head> of the page". Instead, it returns something like

<!DOCTYPE html>
<html ...>
<head>
...
</head>
<body ...>

when I would have just expected the <head> element and its contents.

I'm not too sure what "parsed" means in this context, either. What would an unparsed <head> look like?

This should either be fixed (which would clearly be a breaking change), or the documentation corrected to match the actual output. It's not clear from the comments on T20608 what the intended output was at the outset.

TTO created this task.Jul 7 2016, 7:12 AM
Restricted Application added subscribers: Zppix, Aklapper. · View Herald TranscriptJul 7 2016, 7:12 AM
Anomie added a subscriber: Anomie.Jul 7 2016, 1:34 PM

The option seems to correspond to whatever OutputPage::headElement() returns, so the documentation should be fixed to reflect that.

Anomie moved this task from Unsorted to Non-Code on the MediaWiki-API board.Jul 7 2016, 1:34 PM
Aklapper renamed this task from API action=parse&prop=headhtml returns more than just the <head> element to API action=parse&prop=headhtml returns more than just the <head> element: Fix documentation.Jul 7 2016, 2:13 PM
Restricted Application added a project: Documentation. · View Herald TranscriptJul 7 2016, 2:13 PM