HTML tags not being rendered

gmak - March 13, 2007 - 01:00
Project:PEAR Wiki Filter
Version:5.x-1.1
Component:Code
Category:support request
Priority:normal
Assigned:Unassigned
Status:by design
Description

I've got pear wiki filter working, but I can't seem to get it to allow html tags to be rendered. I've tried with and without the HTML filter included, but it always seems to just output the tag. So, I see <strong>TEST</strong> instead of TEST (or similar).

Can you provide some guidance on how to use HTML tags with Pear Wiki Filter?

Thanks

#1

rötzi - March 13, 2007 - 02:23

I have been working on this, but didn't had the time to test it really. I uploaded it now to the Drupal-5 branch, so the dev version will have the option 'Allow HTML'. If you use that you can enter HTML tags directly. I would be glad if you could test if the option works for you.

You don't have to use the HTML filter together with PEAR wiki filter. If the 'Allow HTML' option is activated, the rendered text runs through 'filter_xss' of Drupal. This strips some attributes from the tags. In my test, 'class' was not stripped but the 'style' attribute was.

I don't know if this is the final behaviour. I will look if I can get the two filters to work together so that you can specify which tags are allowed in the HTML filter and PEAR wiki filter uses this setting. But for now just disable the HTML filter and use the setting of pearwiki filter.

#2

gmak - March 13, 2007 - 10:41

Okay, I've installed the latest dev branch and I can see that there is a tick box for "Allow HTML Tags". I've turned that on and put in a series of tags in the "Ignore Tags" area. But, HTML tags are still being shown like <strong>blah</strong>.

As a test, I also tried without any tags in the "Ignore Tags" area, but this results in the same behaviour.

This would be a great feature, as many of our users aren't going to be too keen on direct input of wiki syntax. With the ability to use HTML tags, we could provide them with a WYSIWYG toolbar so that they wouldn't need to worry about coding.

Thanks for some great work on PearWiki

#3

rötzi - April 4, 2007 - 18:33

It looks like the dev package does not contain the current CVS version. Do you have the file 'pearwiki_filter/pear_override/parse/Ignorehtml.php' in your directory?

If not, can you try the CVS version. You get it with this command:

cvs -d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal checkout -r DRUPAL-5 -d pearwiki_filter contributions/modules/pearwiki_filter

#4

kvarnelis - June 26, 2007 - 22:11

I'm trying to make TinyMCE and mediawiki formatting live together and while I realize it's a bit of a stretch, it'd be great for end users.

I've downloaded what I think are the appropriate files (CVS is a little beyond me right now, sorry, so I just downloaded what appeared to be the correct files from the CVS site...please forgive me if I've screwed up here).

I've added pearwiki_filter/pear_override/parse/ignorehtml.php, /pearwiki_filter/pear_override/render/Xhtml/ignorehtml.php, and /pearwiki_filter/pear_override/pearwiki_filter.module

I have ignore html checked. In general, it's a vast improvement, the strong tags and so on don't appear.

Anyway, it works, the only problem is that when TinyMCE interprets characters that it maps as html entities, the filter interprets them literally. Hence,

the issue of sorting &quot;political blogs&quot;

instead of
the issue of sorting "political blogs"

#5

mennonot - November 9, 2007 - 00:18

I'm trying to get mediawiki syntax and Drutex to work together and I've followed all the instructions above, including downloading cvs versions of pearwiki_filter/pear_override/parse/ignorehtml.php, /pearwiki_filter/pear_override/render/Xhtml/ignorehtml.php, though I can't locate /pearwiki_filter/pear_override/pearwiki_filter.module

With these additional files installed I've added these tags to the "Ignore tags:" field in the Pear wiki settings in the input format configuration page:

<p> <img> <table> <tr> <td>

but the Drutex code is still being converted and comes out looking like this when accessed in the browser:

<p><img class="teximage" src="/drupal/files/tex/190d03b2bf8f81786153f20187e2ada93f0918dc.png" alt="$ \sum_{k=1}^\infty \frac{1}{k} $" /></p> <table class="displaymath"> <tr> <td class="dspleft"><img class="teximage" src="/drupal/files/tex/2d441c3f5501b337a1107fedc2600287b78b1163.png" alt="\[ x^2 \]" /></td> <td class="dspright"></td> </tr> </table> <p> and
<table class="displaymath"> <tr> <td class="dspleft"><img class="teximage" src="/drupal/files/tex/a96ac7e789c2b602cfd5739cab079735c756af42.png" alt="$$x^2$$" /></td> <td class="dspright"></td> </tr> </table>

Is this because I'm still missing a file (perhaps /pearwiki_filter/pear_override/pearwiki_filter.module as mentioned by kvarnelis)? Or is there something else I'm missing?

#6

kvarnelis - January 14, 2008 - 19:50

I'd forgotten about this six month old issue only to try again with Pearwiki... I kept wondering, why am I not using this... reinstalled it and have the problem again. I've long ago given up on TinyMCE since there is no interest in supporting my users who are on Safari and am using FCKeditor now, but the problem is the same. <br /> and &nbsp; are appearing. I don't know how to get rid of these. Any ideas?

#7

wad - April 7, 2008 - 06:41
Version:5.x-1.x-dev» 5.x-1.1
Status:active» by design

I'm not sure about what was in the code a year ago, but this is the way it should be in the current release. If you Configure an Input format that has the PEAR Wiki Filter enabled, you will see a list of tags to ignore. Just add all the tags you allow in your HTML filter (without the angle brackets) and it will pass them through unmodified. Otherwise, it will consider them an XSS risk and convert them to a harmless element - as we discovered :)

 
 

Drupal is a registered trademark of Dries Buytaert.