[Pmwiki-users] wikiware to allow html in pages
raeky
kasslloyd
Fri Jul 16 10:45:52 CDT 2004
Also forgot to note you want to make sure there is no evil
javascript's or or attributes on elements. The previous link to
strip_tags() has some user comments that deals with those.
Having HTML tags as an option in a wiki is nice, since some people are
more familar with them then wiki-markup. And its easier to format a
page the way you want with style tags and such then to try to do this
with wiki-markup.
Just make sure you strip out everything in <script></script> and get
any java attributes to a tag.
Kass
On Thu, 15 Jul 2004 15:51:18 -0300, J. Meijer <commentgg at hotmail.com> wrote:
>
> Below some freshware to allow html in pages. Only a restricted set of tags
> is allowed. If your wiki is private you may want to add some tags. The list
> of tags allowed is easily modified.
>
> There are two versions. V1 always allows (and converts) html tags. V2
> enables this after a line with a [[html]] directive. Its [[nohtml]]
> directive cancels [[html]] enabled or V1 html-processing.
>
> -jm
>
> ps I'm probably duplicating somebody's efforts here.
>
> # list tags for html tag recognition
> $OkHtml='HTML|HEAD|TITLE|META|STYLE|BODY|INPUT|FORM'.
> '|TABLE|TBODY|TR|TD|CODE|PRE|CITE|SPAN|FONT'.
> '|BR|P|DIV|CENTER|IMG|A|B|I|S|BLOCKQUOTE|UL|OL|LI';
> $OkHtml="/<([\/]?(?:$OkHtml)(?: .+?)?\\w*)>/i";
>
> # V1: globally enable (registered) html tags recognition
> $InlineReplacements[$OkHtml]= '<$1>';
>
> # V2: let [[html]] directive enable (registered) html tags
> $DoubleBrackets["/\\[\\[html\\]\\]/e"]=
> "(\$InlineReplacements['$OkHtml']='<\\$1>')?'':'';";
>
> # V2: let [[nohtml]] directive disable V1 or [[html]] processing
> $DoubleBrackets["/\\[\\[nohtml\\]\\]/e"]= 'unsetHtml();';
> function unsetHtml() {
> global $OkHtml,$InlineReplacements;
> unset($InlineReplacements[$OkHtml]);
> return '';
> }
>
> # insert the code as usual in your local/config.php
>
>
> --
> Pmwiki-users mailing list
> Pmwiki-users at pmichaud.com
> http://pmichaud.com/mailman/listinfo/pmwiki-users_pmichaud.com
>
More information about the pmwiki-users
mailing list