> > On Feb 5, 2014 8:38 AM, "Zachary Harris" <[email protected]> wrote: > > > > 1) Is there a way to tell the Parser that you don't want the initial DOM > > element wrapped in paragraph tags? (For example, if you are client-side > > injecting the mw-api contents into already existing content and you > > don't want a paragraph break there?) It seems this same question was > > effectively asked at > > http://www.mediawiki.org/wiki/API_talk:Parsing_wikitext and hasn't been > > answered yet. > > If the parser can't be configured in this way and I have to strip > > possibly undesired openings tags myself do I have any guarantees on what > > to expect?
Not really. Even innternally in core (in OutputPage and in Message class) we regex out the <p> when its not wanted. (Icky!) > > > > > 2) Why do JSON results come back, for example, in the form of > > parse.text['*'] rather than just parse.text? With format=XML the result > > is just <parse><text>the stuff</text></parse>. Why the "*"? Sorry if > > this question is dumb. > > >From what i've heard, historical reasons mostly. I believe its so that the xml can be mechanically turned into json - the text body of an element is treated like an attribute * so that if that element had attributes they could also be represented. -bawolff
_______________________________________________ Mediawiki-api mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
