I want to get the content of <math>
tags in the API response MediaWiki.
I've tried to use this query: https://en.wikipedia.org/w/api.php?action=query&prop=extracts&format=xml&titles=delta-v
And I'm getting valid xml file, but in place of
I'm getting:
<dl><dd></dd></dl>
And what I want is:
<math>\Delta{v} = \int_{t_0}^{t_1} {\frac {|T|} {m}}\, dt</math>
Which is available via "Edit" button here: http://en.wikipedia.org/w/index.php?title=Delta-v&action=edit
is this somehow available via API?
You need to query for the whole page source, using MediaWiki's native API function:
That will give you exactly the same thing as you see when editing the page.
The prop=extracts
query is implemented by the extension TextExtracts, and does not always work with code content generated by other extensions (such as Math). It can probably be considered a bug in TextExtracts, but given the complexity of page rendering in MediaWiki, and the number of ways in which various extensions add to the content, it will probably never catch everything.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments