We did upgrade from Tridion 5.3 to Tridion 2011 SP1.
In Tridion 5.3 we were using VBScript Templates, as a part of this upgrade we are converting existing VBScript Templates to Compound Component Templates. We are facing below mentioned two issues with the content of RTF field.
Issue 1 : In our existing content of RTF field we have empty tags/HTML Tags at number of locations. eg.<a name="Contact" id="Contact"></a>
When we publish the content with Compound Component Templates (Tridion 2011 SP1 environment) above mentioned anchor tag is getting converted to <a name="Contact" id="Contact" />
. This is breaking existing javascript functionality. To overcome the issue we have written C# functions which finds empty tags and replace the inner text with
like <a name="Contact" id="Contact"> </a>
then things are working fine. But to call this function at CT level for each RTF field is big activity as we have number Component Tempate. Is there any better way to do it.
Issue 2 : In the same RTF field we have content like  
(may be editors have copy pasted it from web or somewhere), so when we try to publish page or component it is getting failed with error.
JScriptException:Expression valueUnterminated String Constant.
Is there any default TBB which will help to fix the issues?