1 (edited by beasel 2011-08-02 13:33:01)

Topic: htmLawed for use with Mediawiki

Hey, I just had some questions about using htmLawed with MediaWiki - is this possible? Or was it developed exclusively or only for use with LabWiki?

Depending on the answer to this question, I will have more, mostly on the topic of installing the plugin in MediaWiki. Thank you very much.

2

Re: htmLawed for use with Mediawiki

htmLawed can be used with MediaWiki. For this, one will have to write a plugin or modify MediaWiki's code so that input text $in to be filtered as per settings specified by $config and/or $spec is handled by the htmLawed() function:

include('htmlawed.php');
...
$out = htmLawed($in, $config, $spec);

I am not aware of or have looked for an htmLawed plugin for MediaWiki. There are plugins for other software like Drupal and Joomla.

3 (edited by beasel 2011-08-03 10:15:11)

Re: htmLawed for use with Mediawiki

For clarification purposes - do we insert that line ( include ('htmlawed.php')).. into the code for htmLawed or into the config.php for the wiki itself? Also, will it take heavy duty editing of the code itself to implement this?

Thank you for the response!

4

Re: htmLawed for use with Mediawiki

I do not know the internal logic of MediaWiki regarding parsing and rendering of input text, so I cannot say how the MediaWiki code should be modified. But assuming you can find the location of the code where MediaWiki does this task, and assuming $X is the value of the final output returned/generated by MediaWiki, then, right after this code, you can try something like this:

include("../path/to/htmLawed.php");
// our htmLawed settings
$config = array(...);
$spec = ...; // optional
// filter MediaWiki's output
$X = htmLawed($X, $config, $spec);