Page MenuHomePhabricator

API generates invalid HTML for format=jsonfm
Closed, ResolvedPublic


To reproduce, go to

Everything after the < is colored blue, and the HTML is obviously invalid:

<pre style='white-space: pre-wrap;'>

&quot;query&quot;: {
    &quot;pages&quot;: {
        &quot;-1&quot;: {
            &quot;title&quot;: &quot;<span style="color:blue;">&lt;&quot;,
            &quot;invalid&quot;: &quot;&quot;


Version: 1.24rc
Severity: minor



Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 3:17 AM
bzimport added a project: MediaWiki-API.
bzimport set Reference to bz65403.
bzimport added a subscriber: Unknown Object (MLST).

Change 133739 had a related patch set uploaded by PleaseStand:
API: Skip all HTML transformations for non-XML formats

Change 161093 had a related patch set uploaded by Anomie:
API: Clean up and internationalize pretty-printed output

Change 133739 merged by jenkins-bot:
API: Remove XML tag highlighting from non-XML formats

Well, the HTML is still invalid, though at least the tags should now be balanced.

For example,

Error Line 34, Column 2302: Bad value\n for attribute href on element a: Illegal character in query: not a URL code point.


Syntax of URL:

Any URL. For example: /hello, #canvas, or Characters should be represented in NFC and spaces should be escaped as %20.

Error Line 44, Column 8: Stray start tag script.


Error Line 44, Column 8: Cannot recover after last error. Any further errors will be ignored.


The aforementioned (comment 2) pretty-printing cleanup *should* fix these, though at the time of writing, the current version of the patch still adds the script element after the </html>.

Change 161093 merged by jenkins-bot:
API: Clean up and internationalize pretty-printed output

Should be deployed to WMF wikis with 1.25wmf4, see for the schedule.