Last modified: 2014-10-26 20:19:41 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T67403, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 65403 - API generates invalid HTML for format=jsonfm
API generates invalid HTML for format=jsonfm
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
API (Other open bugs)
1.24rc
All All
: Low minor (vote)
: ---
Assigned To: Nobody - You can work on this!
https://en.wikipedia.org/w/api.php?ac...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-05-16 16:16 UTC by Kevin Israel (PleaseStand)
Modified: 2014-10-26 20:19 UTC (History)
5 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Kevin Israel (PleaseStand) 2014-05-16 16:16:02 UTC
To reproduce, go to <https://en.wikipedia.org/w/api.php?action=query&titles=%3C&format=jsonfm>.

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;
            }
        }
    }
}
</pre>
[...]
Comment 1 Gerrit Notification Bot 2014-05-16 17:08:43 UTC
Change 133739 had a related patch set uploaded by PleaseStand:
API: Skip all HTML transformations for non-XML formats

https://gerrit.wikimedia.org/r/133739
Comment 2 Gerrit Notification Bot 2014-09-17 21:25:28 UTC
Change 161093 had a related patch set uploaded by Anomie:
API: Clean up and internationalize pretty-printed output

https://gerrit.wikimedia.org/r/161093
Comment 3 Gerrit Notification Bot 2014-09-23 19:52:22 UTC
Change 133739 merged by jenkins-bot:
API: Remove XML tag highlighting from non-XML formats

https://gerrit.wikimedia.org/r/133739
Comment 4 Kevin Israel (PleaseStand) 2014-09-26 23:17:06 UTC
Well, the HTML is still invalid, though at least the tags should now be balanced.

For example, <http://validator.w3.org/check?uri=https%3A%2F%2Fwww.mediawiki.org%2Fw%2Fapi.php%3Faction%3Dquery%26prop%3Drevisions%26rvprop%3Dcontent%26titles%3DAPI%3AMain_page%26format%3Djsonfm&charset=%28detect+automatically%29&doctype=Inline&group=0>:

----

Error Line 34, Column 2302: Bad value http://en.wikipedia.org/w/api.php?format=json&action=query&titles=Main%20Page&prop=revisions&rvprop=content\n for attribute href on element a: Illegal character in query: not a URL code point.

…p;prop=revisions&amp;rvprop=content\n">http://en.wikipedia.org/w/api.php?forma…

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

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

<script>if(window.mw){

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

<script>if(window.mw){

----

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>.
Comment 5 Gerrit Notification Bot 2014-10-13 23:39:12 UTC
Change 161093 merged by jenkins-bot:
API: Clean up and internationalize pretty-printed output

https://gerrit.wikimedia.org/r/161093
Comment 6 Brad Jorsch 2014-10-13 23:49:12 UTC
Should be deployed to WMF wikis with 1.25wmf4, see https://www.mediawiki.org/wiki/MediaWiki_1.25/Roadmap for the schedule.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links