Last modified: 2013-05-13 22:08:14 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 T50372, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 48372 - Missing information in action=parse&prop=links
Missing information in action=parse&prop=links
Status: NEW
Product: MediaWiki
Classification: Unclassified
API (Other open bugs)
1.22.0
All All
: Lowest enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-05-12 09:48 UTC by DavidL
Modified: 2013-05-13 22:08 UTC (History)
4 users (show)

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


Attachments

Description DavidL 2013-05-12 09:48:05 UTC
There is some information missing from result of the API call to action=parse&prop=links

Example:
foo]]%20[[API:Query|bar]]%20[[API:Query|other]]%20[http://www.example.com/%20baz">https://en.wikipedia.org/w/api.php?action=parse&prop=links&format=json&text=[[foo]]%20[[API:Query|bar]]%20[[API:Query|other]]%20[http://www.example.com/%20baz]

The result of such call contains link list, but there is missing information:
- The text for each link would be useful for some bot actions
- The offset of the link should also be given

Each link may appear multiple times in the parsed wiki page, so the above missing information would need to be repeated for each instance of the link.

For the JSON format the result for the above example would be:
 {"parse":{"title":"API","links":[{"ns":0,"*":"Foo","exists":"",[{offset:0}]},{"ns":0,"*":"API:Query"},[{offset:8,text="bar"},{offset:26,text="other"}]]}}
Comment 2 Brad Jorsch 2013-05-13 22:08:14 UTC
It's already enough trouble trying to get the offsets for sections out of the parser (see bug 25203). Trying to manipulate the parser to extract position and piped text for every wikilink is probably not going to happen.

If you want that level of parsing, look into parsing the wikitext in your client instead.

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


Navigation
Links