[TYPO3-RTE] Automatic word clean?

Erik Svendsen erik at linnearad.no
Mon Dec 1 16:59:47 CET 2008


Hello Christopher,

> Hi Erik,
> 
> I have tested it now, but it does not work at all:
> 
> I read the following docs:
> http://typo3.org/documentation/document-library/extension-manuals/rteh
> tmlarea/1.4.4/view/4/4/
> http://typo3.org/documentation/document-library/references/doc_core_ts
> ref/4.1.0/view/5/17/
> 
> And I saw a discussion in this newsgroup:
> http://lists.netfielders.de/pipermail/typo3-project-rte/2008-August/00
> 1251.html
> (The author also states that it does not seem to work correctly; but
> there
> is no solution.)

It works in at least 6 of my installations. Look at this short flash video 
http://linnearad.no/index.php?id=526, and you see the attributes are cleaned 
up. Of course I'm using rtehtmlarea 1.7.7 and 1.5.6.


> I am trying something like the follwoing at the moment, but it does
> not change anything:
> 
> RTE.default.proc.entryHTMLparser_db {
> noAttrib = b, i, u, strike, sub, sup
> # Remove if no attribs:
> rmTagIfNoAttrib = span, div, font
> tags {
> p.fixAttrib.align.unset >
> div.fixAttrib.align.unset >
> font.allowedAttribs = color, face, size
> p.allowedAttribs = class, style, align
> # PROBLEM: does not work
> h1.remap = b
> h2.remap = b
> h3.remap = b
> h4.remap = b
> h5.remap = b
> h6.remap = b
> }
> }
> ...

Is remap possible to use at all here.


> RTE.default.enableWordClean = 1
> RTE.default.enableWordClean.HTMLparser = 1
> RTE.default.enableWordClean.HTMLparser <
> RTE.default.proc.entryHTMLparser_db
> RTE.default.enableWordClean.HTMLparser {
> # HTMLparser config
> allowTags (
> blockquote, b, br, caption, center, col,
> colgroup,
> div, em, h1, h2, h3, h4, h5, h6, hr, i, img, li, link, ol, p, pre,
> strong,
> table, thead, tbody, tfoot, td, th, tr, tt, ul, var )
> tags {
> p {
> # do not allow class.
> allowedAttribs = id, title, dir, lang,
> xml:lang
> fixAttrib.align.unset = 1
> fixAttrib.style.unset = 1
> }
> # take away color, face, size
> # Does NOT work.
> font.allowedAttribs >
> # Does NOT work either.
> h1.remap = b
> h2.remap = b
> h3.remap = b
> h4.remap = b
> h5.remap = b
> }
> rmTagIfNoAttrib = span
> removeTags = u, o:p, font
> }
> }
> What can I do?
> 
> Christopher
> 

Will never work as far as I can say, as you are mixing different kind of 
RTE transformation as far as I understand, HTMLparser and HTMLparser_db have 
tested following code

RTE.default {
  enableWordClean = 1
  enableWordClean.HTMLparser < 1 #or = 1
  enableWordClean.HTMLparser {
     allowTags = b,i,u,a,img,br,div,center,pre,font,hr,sub,sup,p,strong,//
                      em,li,ul,ol,blockquote,strike,span,h1,h2,h3,h4,h5,h6,acronym,//
                      cite,abbr,address,caption,table,tr,td,col,colgr,tbody,th,thead,tfoot
     denyTags = meta,title
     noAttrib = table,tr,td
     removeTags = u,o:p,font
     rmTagIfNoAttrib = span
     tags {
       h1.remap = b
       p {
         allowedAttribs = id,title,dir,lang,xml:lang
         fixAttrib.align.unset = 1
         fixAttrib.style.unset = 1
       }
      }
  }
}

And it remaps, and cleans the pasted text as it should when I test it in 
TYPO3 4.2.3


WBR,
Erik Svendsen
www.linnearad.no




More information about the TYPO3-project-rte mailing list