From 452db479cd0f11a916df25cb57243ca9982a27c5 Mon Sep 17 00:00:00 2001 From: low012 Date: Wed, 2 Nov 2005 23:28:54 +0000 Subject: [PATCH] *) bugfix: "21" was displayed as "21" in yacyWiki git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@1017 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- source/de/anomic/data/wikiCode.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/source/de/anomic/data/wikiCode.java b/source/de/anomic/data/wikiCode.java index fd28ea512..188974fc2 100644 --- a/source/de/anomic/data/wikiCode.java +++ b/source/de/anomic/data/wikiCode.java @@ -65,7 +65,7 @@ public class wikiCode { private boolean preformatted = false; //needed for preformatted text private boolean preformattedSpan = false; //needed for
 and 
spanning over several lines private int preindented = 0; //needed for indented
s
-    private int escindented = 0;
+    private int escindented = 0;              //needed for indented [=s
         
     public wikiCode(plasmaSwitchboard switchboard){
         sb=switchboard;
@@ -98,9 +98,10 @@ public class wikiCode {
         int p0;
 	
 	// avoide html inside
-	//p0 = 0; while ((p0 = result.indexOf("&", p0)) >= 0) result = result.substring(0, p0) + "&" + result.substring(p0 + 1);
+	// Ampersands have to be replaced first. If they were replaced later,
+	// other replaced characters containing ampersands would get messed up.
+	p0 = 0; while ((p0 = result.indexOf("&", p0)) >= 0) {result = result.substring(0, p0) + "&" + result.substring(p0 + 1); p0++;}
 	p0 = 0; while ((p0 = result.indexOf('"', p0)) >= 0) result = result.substring(0, p0) + """ + result.substring(p0 + 1);
-	p0 = 0; while ((p0 = result.indexOf('&', p0)) >= 0) {result = result.substring(0, p0) + "&" + result.substring(p0 + 1); p0++;}
 	p0 = 0; while ((p0 = result.indexOf("<", p0)) >= 0) result = result.substring(0, p0) + "<" + result.substring(p0 + 1);
 	p0 = 0; while ((p0 = result.indexOf(">", p0)) >= 0) result = result.substring(0, p0) + ">" + result.substring(p0 + 1);
 	//p0 = 0; while ((p0 = result.indexOf("*", p0)) >= 0) result = result.substring(0, p0) + "•" + result.substring(p0 + 1);