Background
It is a common need to parse arbitrary wikitext for a template invocation. This has been reinvented many times over – for example mwparserfromhell (Python), wtf_wikipedia and wikiapi (JavaScript), etc. Yet, in MediaWiki itself there is no straightforward way to parse templates. One must use the Core preprocessor directly and iterate over the DOM tree.
If the bots can do it easily, a MW extension or Core feature should as well.
Proposed solution
Introduce a method to find a template invocation in arbitrary wikitext and return the parameters and values as an associative array. The values should be kept as the original wikitext with strip markers removed.
In turn, this allows a new and more user-friendly means to interact with extensions through wikitext, as opposed to traditional parser tags and functions.