*) beautifying code and a little comment

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@1401 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
low012 19 years ago
parent 319f8ffb18
commit ef22fa8bf2

@ -131,7 +131,7 @@ public class wikiCode {
//This array contains codes (see http://mindprod.com/jgloss/unicode.html for details) and //This array contains codes (see http://mindprod.com/jgloss/unicode.html for details) and
//patterns that will be replaced. To add new codes or patterns, just put them at the end //patterns that will be replaced. To add new codes or patterns, just put them at the end
//of the list. //of the list. Codes or patterns in this list can not be escaped with [= or <pre>
public static String[] htmlentities={ public static String[] htmlentities={
// Ampersands _have_ to be replaced first. If they were replaced later, // Ampersands _have_ to be replaced first. If they were replaced later,
// other replaced characters containing ampersands would get messed up. // other replaced characters containing ampersands would get messed up.
@ -540,7 +540,6 @@ public class wikiCode {
//escape code ([=...=]) contributed by [MN] //escape code ([=...=]) contributed by [MN]
//both [= and =] in the same line //both [= and =] in the same line
else if(((p0 = result.indexOf("[="))>=0)&&((p1 = result.indexOf("=]"))>0)&&(!(preformatted))){ else if(((p0 = result.indexOf("[="))>=0)&&((p1 = result.indexOf("=]"))>0)&&(!(preformatted))){
//if(p0 < p1){
String escapeText = result.substring(p0+2,p1); String escapeText = result.substring(p0+2,p1);
//BUGS TO BE FIXED: [=[=text=]=] does not work properly: //BUGS TO BE FIXED: [=[=text=]=] does not work properly:
@ -549,14 +548,10 @@ public class wikiCode {
// //
//handlicg cases where the text inside [= and =] also contains //handlicg cases where the text inside [= and =] also contains
//[= and =]. Example: [=[=...=]=] //[= and =]. Example: [=[=...=]=]
//if(escapeText)
//else{
result = transformLine(result.substring(0,p0).replaceAll("!esc!", "!esc!!")+"!esc!txt!"+result.substring(p1+2).replaceAll("!esc!", "!esc!!"), switchboard); result = transformLine(result.substring(0,p0).replaceAll("!esc!", "!esc!!")+"!esc!txt!"+result.substring(p1+2).replaceAll("!esc!", "!esc!!"), switchboard);
result = result.replaceAll("!esc!txt!", escapeText); result = result.replaceAll("!esc!txt!", escapeText);
result = result.replaceAll("!esc!!", "!esc!"); result = result.replaceAll("!esc!!", "!esc!");
//}
//}
} }
//start [= //start [=
@ -596,12 +591,10 @@ public class wikiCode {
//implementation very similar to escape code (see above) //implementation very similar to escape code (see above)
//both <pre> and </pre> in the same line //both <pre> and </pre> in the same line
else if(((p0 = result.indexOf("&lt;pre&gt;"))>=0)&&((p1 = result.indexOf("&lt;/pre&gt;"))>0)&&(!(escaped))){ else if(((p0 = result.indexOf("&lt;pre&gt;"))>=0)&&((p1 = result.indexOf("&lt;/pre&gt;"))>0)&&(!(escaped))){
//if(p0 < p1){
String preformattedText = "<pre style=\"border:dotted;border-width:thin\">"+result.substring(p0+11,p1)+"</pre>"; String preformattedText = "<pre style=\"border:dotted;border-width:thin\">"+result.substring(p0+11,p1)+"</pre>";
result = transformLine(result.substring(0,p0).replaceAll("!pre!", "!pre!!")+"!pre!txt!"+result.substring(p1+12).replaceAll("!pre!", "!pre!!"), switchboard); result = transformLine(result.substring(0,p0).replaceAll("!pre!", "!pre!!")+"!pre!txt!"+result.substring(p1+12).replaceAll("!pre!", "!pre!!"), switchboard);
result = result.replaceAll("!pre!txt!", preformattedText); result = result.replaceAll("!pre!txt!", preformattedText);
result = result.replaceAll("!pre!!", "!pre!"); result = result.replaceAll("!pre!!", "!pre!");
//}
} }
//start <pre> //start <pre>

Loading…
Cancel
Save