Question

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 '&lt' and '&gt'. Also mediawiki displays html and not an actual link.

How do I make mediawiki API calls and keep link information?

Was it helpful?

Solution

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
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top