diff --git a/source/de/anomic/data/wikiCode.java b/source/de/anomic/data/wikiCode.java index 26764101d..f035a1caf 100644 --- a/source/de/anomic/data/wikiCode.java +++ b/source/de/anomic/data/wikiCode.java @@ -71,11 +71,12 @@ public class wikiCode { private String ListLevel=""; private String defListLevel=""; private plasmaSwitchboard sb; - private boolean escape = false; //needed for escape - private boolean escaped = false; //yat another varaible needed for
 not getting in the way
-    private boolean escapeSpan = false; //needed for escape symbols [= and =] spanning over several lines    
-    private boolean preformatted = false;     //needed for preformatted test
+    private boolean escape = false;           //needed for escape
+    private boolean escaped = false;          //needed for 
 not getting in the way
+    private boolean escapeSpan = false;       //needed for escape symbols [= and =] spanning over several lines 
+    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
         
     public wikiCode(plasmaSwitchboard switchboard){
         sb=switchboard;
@@ -430,25 +431,37 @@ public class wikiCode {
 	//both 
 and 
in the same line else if(((p0 = result.indexOf("<pre>"))>=0)&&((p1 = result.indexOf("</pre>"))>=0)&&(!(escaped))){ String preformattedText = "
"+result.substring(p0+11,p1)+"
"; - result = transformLine(result.substring(0,p0)+"!preformatted!!Text!"+result.substring(p1+12), switchboard); + result = transformLine(result.substring(0,p0)+"!preformatted!!Text!"+result.substring(p1+12), switchboard); result = result.replaceAll("!preformatted!!Text!", preformattedText); } //start
 	else if(((p0 = result.indexOf("<pre>"))>=0)&&(!preformattedSpan)&&(!(escaped))){
 	    preformatted = true;    //prevent surplus line breaks
+	    String bq ="";  //gets filled with 
s as needed String preformattedText = "
"+result.substring(p0+11);
-	    result = transformLine(result.substring(0,p0)+"!preformatted!!Text!", switchboard);
-	    result = result.replaceAll("!preformatted!!Text!", preformattedText);
+	    //taking care of indented lines
+	    while(result.substring(preindented,p0).startsWith(":")){
+	        preindented++;
+		bq = bq + "
"; + } + result = transformLine(result.substring(preindented,p0)+"!preformatted!!Text!", switchboard); + result = bq + result.replaceAll("!preformatted!!Text!", preformattedText); preformattedSpan = true; } //end
else if(((p0 = result.indexOf("</pre>"))>=0)&&(preformattedSpan)&&(!(escaped))){ preformattedSpan = false; + String bq = ""; //gets filled with
s as needed String preformattedText = result.substring(0,p0)+"
"; + //taking care of indented lines + while (preindented > 0){ + bq = bq + ""; + preindented--; + } result = transformLine("!preformatted!!Text!"+result.substring(p0+12), switchboard); - result = result.replaceAll("!preformatted!!Text!", preformattedText); + result = result.replaceAll("!preformatted!!Text!", preformattedText)+bq; preformatted = false; } //end contrib [MN]