Un-entify our entified characters prior to entifying them so that if text

is passed through the filter repeatedly it won't continually expand
the ampersands until an ugly thing remains.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@1624 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
ray
2005-03-18 00:04:51 +00:00
parent f1441c6ca8
commit 44c8b286a6
@@ -39,10 +39,18 @@ public class HTMLUtil
{
// this could perhaps be done more efficiently, but this function
// is not likely to be called on large quantities of text
// (first we turn the entified versions normal so that if text is
// repeatedly run through this it doesn't keep changing successive
// &'s into "&".
text = StringUtil.replace(text, """, "\"");
text = StringUtil.replace(text, ">", ">");
text = StringUtil.replace(text, "&lt;", "<");
text = StringUtil.replace(text, "&amp;", "&");
text = StringUtil.replace(text, "&", "&amp;");
text = StringUtil.replace(text, "<", "&lt;");
text = StringUtil.replace(text, ">", "&gt;");
return StringUtil.replace(text, "\"", "&quot;");
text = StringUtil.replace(text, "\"", "&quot;");
return text;
}
/**