diff options
author | michelou <michelou@epfl.ch> | 2003-08-28 08:39:36 +0000 |
---|---|---|
committer | michelou <michelou@epfl.ch> | 2003-08-28 08:39:36 +0000 |
commit | 07493a2465d1caab4fb18fba2a1525a136fd4252 (patch) | |
tree | 8187bed2c346d73b8ac0eae7caeced16b05828a1 /sources/ch/epfl/lamp/util | |
parent | 3cda488d5a441597594d691279c28fea4f6ad4c5 (diff) | |
download | scala-07493a2465d1caab4fb18fba2a1525a136fd4252.tar.gz scala-07493a2465d1caab4fb18fba2a1525a136fd4252.tar.bz2 scala-07493a2465d1caab4fb18fba2a1525a136fd4252.zip |
*** empty log message ***
Diffstat (limited to 'sources/ch/epfl/lamp/util')
-rw-r--r-- | sources/ch/epfl/lamp/util/HTMLPrinter.java | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/sources/ch/epfl/lamp/util/HTMLPrinter.java b/sources/ch/epfl/lamp/util/HTMLPrinter.java index 04662bb910..6a1bd3dbe3 100644 --- a/sources/ch/epfl/lamp/util/HTMLPrinter.java +++ b/sources/ch/epfl/lamp/util/HTMLPrinter.java @@ -28,8 +28,10 @@ public class HTMLPrinter { /* * The characters which must be HTML encoded */ - private static final Character LT = new Character('<'); - private static final Character GT = new Character('>'); + private static final Character AMP = new Character('&'); + private static final Character GT = new Character('>'); + private static final Character LT = new Character('<'); + private static final Character QUOT = new Character('"'); //######################################################################## // Private Fields @@ -112,8 +114,10 @@ public class HTMLPrinter { * @param ch */ public static String encode(Character ch) { - if (LT.compareTo(ch) == 0) return "<"; - else if (GT.compareTo(ch) == 0) return ">"; + if (AMP.compareTo(ch) == 0) return "&"; + else if (GT.compareTo(ch) == 0) return ">"; + else if (LT.compareTo(ch) == 0) return "<"; + else if (QUOT.compareTo(ch) == 0) return """; else return ch.toString(); } |