logo

Personal tools
Vasudeva Plone Administration Configuring Kupu's stripping mechanism
Document Actions

Configuring Kupu's stripping mechanism


Kupu is one of the main text editors people use to edit Plone webpages. It is a very good solid program.


One feature of Kupu is that it "strips" away HTML code that doesnt comply with the XHTML 1.0 standard. Kupu looks for tag attributes like "bgcolor" and "width" (for tables) and cuts them out when it is saving the HTML. This is very good for producing validated code, but some people find it a bit frustrating when all they want to do is stick in a nice coloured table.

However, you can give these attributes a stay of execution:

  1. go to preferences, and click on "Kupu visual editor" on the left hand side.
  2. Go down to the "HTML Filter" box. It should look like this:
    Tags Attributes  
    center,span,tt ect ect..... any tag (If selected Kupu will strip out any occurences of the tags shown.)
    Any tag dir, lang, valign ect..... (If selected Kupu will strip out the tag attribute but keep the tag intact)
    table, th, td width, height (If selected, kupu will remove the selected attributes only if they are with the specified tags)

    If you don't care about XHTML compliance, just uncheck all 3 boxes. If you want to add more tags, just use the two boxes below the table shown above - leaving the attribute box blank will give a result like the first row of the table above, leaving the tag box blank will give results like the second row.
  3. However, to be fair to Kupu,  all the above tags are gradually on the way and are in line to be deprecated at some point in the future. XHTML compliance basically means that presentation and graphics are done with CSS instead of HTML (hence rendering the tags above obsolete) and HTML is just used for good old content.
  4. Bad news though, Kupu by default doesnt like most CSS  styles either! I think it's because introducing them brings a risk that the format of your webpage might not survive a change of skin of your website.
  5. However, you can work around this too by putting whatever CSS styles you want on the "whitelist" located just below the table shown above.
  6. You can also disable the Kupu stripping mechanism entirely, as described on Plone's main site...however, "customizing" the kupucontentfilters.js file as shown is not considered best practise for long-term site development - good for a short fix though.
page created by shane last modified 2006-06-18 06:43