Nope, <nowiki> didn't work...looks like it's being run through the
same parser/sanitizer that regular wiki text goes through...so if that
had worked, they'd have big XSS problems, so that's good I guess...
BTW, only the parser function does this...the tag hook works fine! I
expected as much, though--the tag extensions have to return HTML vs.
wikitext.
Also, I tried the following: I changed my own extension's {{#slmap: }}
parser function to be a near-exact clone of the
smwfProcessInlineQueryParserFunction , except I changed the first
return line, such that the function looks like this:
function slfMapParserFunction(&$parser) {
global $smwgQEnabled, $smwgIP, $smwgIQRunningNumber;
if ($smwgQEnabled) {
$smwgIQRunningNumber++;
require_once($smwgIP . '/includes/SMW_QueryProcessor.php');
$params = func_get_args();
array_shift( $params ); // we already know the $parser ...
return array(0 =>
SMWQueryProcessor
::getResultFromFunctionParams($params,SMW_OUTPUT_WIKI), 'noparse' =>
true, 'isHTML' => true);
} else {
return
smwfEncodeMessages(array(wfMsgForContent('smw_iq_disabled')));
}
}
Incidentally, trying to pass SMW_OUTPUT_HTML as the $outputformat
parameter didn't help, but I figured that would be the case. I also
tried returning the necessary array-wrapped result direct from my
ResultPrinter's getResultText() function, and that didn't work either
(it would have broken the tag hook version anyway).
Obviously, changing smwfProcessInlineQueryParserFunction in this way
would break several things, at least unless you also changed the
SMW_OUTPUT_WIKI to SMW_OUTPUT_HTML...which I'm guessing wouldn't be
near as efficient as the current implementation. So, one possible
solution I see would be to have the SMW
smwfProcessInlineQueryParserFunction function somehow introspect the
ResultPrinter object being used to determine whether it wants to be
returned to the MW parser as wikitext or HTML. But that might be non-
trivial. Even better, I'd still love to hear another way to work
around this! :-)
Ideally I suppose my ResultPrinter class should be able to see the
outputformat parameter and either return wikitext or HTML
accordingly...but I can't really do what I'm trying to do with
wikitext...
-Matt
On Mar 16, 2008, at 7:12 PM, S Page wrote:
> Matt Williamson wrote:
>
>> I wrote a class that subclasses SMWResultPrinter, and it works,
>> except that when it returns its output, it's translating HTML tags
>> into < and >--at least partially.
>
> Surround your output with <nowiki> ... </nowiki> tags?
> Use the HTML entities < and > for < and > ?
>
> Guessing away,
> --
> =S Page
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Semediawiki-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel