[Pmwiki-users] wikiware to allow html in pages
raeky
kasslloyd
Fri Jul 16 10:40:42 CDT 2004
strip_tags() works well for this, and is a built-in function.
http://us2.php.net/manual/en/function.strip-tags.php
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