Reputation: 3
I have an Xpage application that displays emails, received and sent. In particular, my issue is that when using IE 8, the following is displayed right on top, inside the richtext item when mails are received from Outlook:
<!--[if gte mso 9]--><!--[endif]--><!--[if gte mso 9]--><!--[endif]--><br>
how do I remove this text?
I added the following suggestion(s) but no solution thus far:
http://xpageswiki.com/web/youatnotes/wiki-xpages.nsf/dx/Browser_compatibility
Some help would be appreciated.
Upvotes: 0
Views: 69
Reputation: 21709
You say that the unexpected text is displayed inside the RT item. Does this mean that the unexpected text is part of the underlying data in the email that is displayed? If so, then you should look at filtering the rich text content using a custom converter.
Here's an example of using a custom converter to remove font tags. You should be able to use this example to filter your data:
<xp:inputRichText id="inputRichText1" value="#{doc.body}" readonly="true">
<xp:this.converter>
<xp:customConverter>
<xp:this.getAsObject><![CDATA[#{javascript:value}]]></xp:this.getAsObject>
<xp:this.getAsString><![CDATA[#{javascript:
try{
var html=value.toString();
html=html.replace(/<(FONT|font)([ ]([a-zA-Z]+)=(\"|')[^\"\\']+(\"|'))*[^>]+>/g,"")
html=html.replace(/(<\/FONT>|<\/font>)/g,"")
return html;
}catch(e){
print (e);
}}]]>
</xp:this.getAsString>
</xp:customConverter>
</xp:this.converter>
</xp:inputRichText>
Upvotes: 1