[opencms-dev] Cleaning paste from word document - Re-configure jTidy

M Butcher mbutcher at grcomputing.net
Mon Nov 24 20:31:01 CET 2003


The problem, as I understand it, is that the paste operation pastes in 
HTML tags. They are identical to the other legitimate HTML tags that are 
put via the editor, so there is no way for jTidy to tell which it should 
strip and which it should not.

One thing you could do is implement another button -- a "strip 
formatting" button -- that runs JavaScript that strips out all HTML tags 
from the text. An editor could then paste text into the window, click 
the "strip formatting" button, and then add their own formatting.

It's still a little clumsy, but it beats the textpad solution.

[I think that the "htmlArea" HTML editor (you'll have to google for it) 
has a function to do this. It's GPL, and written in JaavScript]

Matt

Olli Aro wrote:
> Thanks Chase,
> 
> That is the process I have been recommending before,
> but you know how the people are like - they want they
> life as easy as possible.
> 
> I am still hoping that there must be a way to do this
> with jTidy, since that is what jtidy is for and
> opencms uses it already. As far as I can see the
> com.opencms.htmlconverter class is an obvious place to
> do it, since it is called everytime you save from the
> WYSIWYG. Can anyone confirm if I am going to the right
> direction with this?
> 
> Olli
> 
> 




More information about the opencms-dev mailing list