Simon Stewart
posted this on November 09, 2011 10:55
You may have noticed a variety of places around TrafficLIVE where we present to the user a mini-html editor that lets you input text with embedded formatting.
That mini-html editor is a standard flex component and to be quite frank, the html it produces is notoriously problematic and where a few font size and textformat problems can originate.
Here is how we fixed it with the quote.items.internalNote property (which also uses that component) which you will be able to see in the standard template.
#if( "$!{item.internalNote}" != "" )
<p class="note">
$item.internalNote.replaceAll("</P>", "<br/>").replaceAll("</?[^>]+[^(br/)]>", "")
</p>
This strips out all the (broken) formatting stored in the string and would allow you to hard code a font in the html of the template for consistency. You could do the same with the quote.quote.jobDetail.notes property.
If you want to keep other formatting (like line breaks or paragraphs) then you could do something like this:
<div class="note">
#set( $strippedNote = $item.internalNote )
#set( $strippedNote = $strippedNote.replaceAll("</?FONT[^>]*>", "") )
#set( $strippedNote = $strippedNote.replaceAll("</?TEXTFORMAT[^>]*>", "") )
$strippedNote
</div>