问题
I have an internal deployment of mediawiki. In some articles are external links. I have another page that makes API calls to the wiki to pull articles into another website. When I pull those articles in, links do not get pulled in properly. Here is an example.
Wiki article:
Use [http://example.com THIS LINK] to contact the vendor.
API URL:
https://mysite.com/mediawiki/api.php?action=query&format=json&prop=extracts&titles=Vendor
API results:
Use THIS LINK to contact the vendor.
Notice the link is completely stripped away. I've also tried to add my own html into mediawiki for links but mediawiki escapes < and > symbols and so the API see's '<' and '>'. Also mediawiki displays html and not an actual link.
How do I make mediawiki API calls and keep link information?
回答1:
For this, you can use action=parse
instead. The query would look like this:
https://mysite.com/mediawiki/api.php?action=parse&format=json&page=Vendor&prop=text
来源:https://stackoverflow.com/questions/16067832/how-do-you-grab-an-article-including-the-links-in-a-usable-format