[TYPO3] How to configure RTE to remove empty tagsets?

Peter Klein peter at umloud.dk
Wed Jan 23 11:10:54 CET 2008


Hi Tyler.
Ok. then there's a reason why I couldn't find a TS solution :)

I ended up with writing a small userFunct to remove those empty tagsets.
Maybe it's useful for other who has the same problem?


-- cut Typoscript SETUP - cut --
page.includeLibs.user_parseFunc = fileadmin/scripts/parseFunc.inc

lib.parseFunc.nonTypoTagUserFunc = user_parseFunc->stripEmptyTags
lib.parseFunc.nonTypoTagUserFunc.tagList = b,strong,i
lib.parseFunc_RTE.nonTypoTagUserFunc = user_parseFunc->stripEmptyTags
lib.parseFunc_RTE.nonTypoTagUserFunc.tagList = b,strong,i

-- cut Typoscript SETUP - cut --


-- cut - File: fileadmin/scripts/parseFunc.inc - cut --
<?php
class user_parseFunc {
 function stripEmptyTags($content,$conf) {
  $tags = explode(',',$conf['tagList']);
  foreach ($tags as $k => $tag) {
   $content = preg_replace('%<'.$tag.'></'.$tag.'>%si', '['.$tag.']', 
$content);
  }
  return $content;
 }
}
?>
-- cut - File: fileadmin/scripts/parseFunc.inc - cut --

The parameter "tagList" defines which tags should get processed.

-- 
Peter Klein/Umloud Untd

"Tyler Kraft" <tyler.kraft at netefficiency.co.uk> skrev i en meddelelse 
news:mailman.1.1201078914.23484.typo3-english at lists.netfielders.de...
> Hi Peter,
>
> Afaik, there isn't one in the RTE. I thought maybe by tweaking the 
> parseFunc or for rendering but I can't see a way to to it there either?
>
>
>
>
>
> Peter Klein wrote:
>> Hi List.
>> Does anyone know how to configure RTEHTMLArea, so that empty tags gets
>> removed?
>>
>> I have some empty bold tags <b></b> which is causing HTML validators to
>> report warnings, but I haven't been able to find a setting that will 
>> remove
>> those.
>> 



More information about the TYPO3-english mailing list