The snippets returned by MediaWiki search API are generated by the search backend MediaWiki is configured to use.
By default, this is the built-in database search, which indeed returns unparsed snippets. To get nicer parsed snippets, you need to install a custom search extension, such as the Lucene-based MWSearch used by Wikipedia and other Wikimedia wikis.