Many people need to parse wikitext but due to its nature all attempts at alternative parsers are incomplete or have failed utterly.
The only parser known to "correctly" parse wikitext is the Parser.php - part of the MediaWiki source.
But it's not possible to use this parser in your own code or as a standalone PHP script because it calls the database directly for various things directly or indirectly, such as parser options which may depend on a user, and the localisation cache.
It would be a good thing if it were possible for third parties, or even unit tests to be able to use the genuine MediaWiki parser without the need for a MdiaWiki install and database import.
It should be possible to pass a string literal to the parser and get HTML back.