|
|
@ -1026,9 +1026,8 @@ public class wikiCode {
|
|
|
|
int p0 = 0;
|
|
|
|
int p0 = 0;
|
|
|
|
int p1 = 0;
|
|
|
|
int p1 = 0;
|
|
|
|
int l = pat.length();
|
|
|
|
int l = pat.length();
|
|
|
|
if ((p0 = input.indexOf(pat)) >= 0) {
|
|
|
|
//replace pattern if a pair of the pattern can be found in the line
|
|
|
|
p1 = input.indexOf(pat, p0 + l);
|
|
|
|
if( ((p0 = input.indexOf(pat)) >= 0) && ((p1 = input.indexOf(pat, p0 + l)) >= 0) ) {
|
|
|
|
if (p1 >= 0) {
|
|
|
|
|
|
|
|
//extra treatment for headlines
|
|
|
|
//extra treatment for headlines
|
|
|
|
if((pat.equals("===="))||(pat.equals("==="))||(pat.equals("=="))){
|
|
|
|
if((pat.equals("===="))||(pat.equals("==="))||(pat.equals("=="))){
|
|
|
|
//add anchor and create headline
|
|
|
|
//add anchor and create headline
|
|
|
@ -1059,9 +1058,10 @@ public class wikiCode {
|
|
|
|
input.substring(p1 + l);
|
|
|
|
input.substring(p1 + l);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//recursion if a pair of the pattern can still be found in the line
|
|
|
|
|
|
|
|
if( ((p0 = input.indexOf(pat)) >= 0) && (input.indexOf(pat,p0 + l) >= 0) ){
|
|
|
|
|
|
|
|
input = pairReplace(input, pat, repl1, repl2);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//recursion if the pattern can still be found in the line
|
|
|
|
|
|
|
|
if(input.indexOf(pat) >= 0) {input = pairReplace(input, pat, repl1, repl2);}
|
|
|
|
|
|
|
|
return input;
|
|
|
|
return input;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|