Hi Frank, hi Mark, hi all,

The post below reminded me of how incredibly useful mStripState is when 
implementing parser hooks. It can be used to unstrip things (like 
<nowiki>) but also to insert things like <nowiki> (e.g. to insert unsafe 
HTML from within a parser function).

It seems that there is no documented or recommended way to access this 
object in MediaWiki. Accessing a member field directly does not seem to 
be future safe. It would be nice if somebody could ask for a documented 
access to this, i.e., for "public function getStripState()", or we might 
all be up for some unpleasant surprises when somebody in MW gets around 
to declaring mStripState private ;-)

Cheers,

Markus


On 02.11.2014 12:12, Frank Baxmann wrote:
> Hi James,
>
> you can try this, works fine in similar case for me:
>
> 1) Create the ask string in php like this:
>
> /$search = "{{#ask: <whatever you want here, i have VARs here too>}}";/
>
> 2) Create the result string which you can manipulate later:
>
>      $resultString =
> $parser->mStripState->unstripBoth($parser->recursiveTagParse( $/search/,
> $frame ),$parser->mStripState);
>
> Greetings
>
> Frank
>
>
> On 01.11.2014 19:18, James Montalvo wrote:
>> I'm creating a parser function in which I'm going to include an ask
>> query. In this particular case I'd like it just return a normal HTML
>> table of results, as if I were to do:
>>
>> {{#ask: [[Category:Some category]]
>> |? Property 1
>> |? Property 2
>> | limit = 10
>> | sort = Property 2
>> }}
>>
>> Once I understand this I'll probably have cases where I need to modify
>> the results of the query before passing it to a result formatter or
>> formatting the results manually. What is the best way to do this using
>> existing SMW methods?
>>
>> Thanks,
>> James
>>
>>
>> ------------------------------------------------------------------------------
>>
>>
>> _______________________________________________
>> Semediawiki-devel mailing list
>> Semediawiki-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/semediawiki-devel
>
>
>
> ------------------------------------------------------------------------------
>
>
>
> _______________________________________________
> Semediawiki-devel mailing list
> Semediawiki-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/semediawiki-devel
>


------------------------------------------------------------------------------
_______________________________________________
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel

Reply via email to