Skip to content

Commit

Permalink
*) bugfix for previous commit
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@1853 6c8d7289-2bf4-0310-a012-ef5d649a1542
  • Loading branch information
low012 committed Mar 8, 2006
1 parent 1c3b415 commit 1965a8c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions source/de/anomic/data/wikiCode.java
Expand Up @@ -515,7 +515,7 @@ private String directory(){
//counting double headlines
doubles = 0;
for(int j=0;j<i;j++){
if(dirElements.get(j).toString().substring(1).replaceAll(" ","_").replaceAll("[^a-zA-Z0-1_]","").equals(element.substring(1).replaceAll(" ","_").replaceAll("[^a-zA-Z0-1_]",""))){
if(dirElements.get(j).toString().substring(1).replaceAll(" ","_").replaceAll("[^a-zA-Z0-9_]","").equals(element.substring(1).replaceAll(" ","_").replaceAll("[^a-zA-Z0-9_]",""))){
doubles++;
}
}
Expand All @@ -532,7 +532,7 @@ private String directory(){
level3++;
String temp = element.substring(1);
element=level1+"."+level2+"."+level3+" "+temp;
directory = directory + "&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"#"+temp.replaceAll(" ","_").replaceAll("[^a-zA-Z0-1_]","")+anchorext+"\" class=\"WikiTOC\">"+element+"</a><br>\n";
directory = directory + "&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"#"+temp.replaceAll(" ","_").replaceAll("[^a-zA-Z0-9_]","")+anchorext+"\" class=\"WikiTOC\">"+element+"</a><br>\n";
}
else if (element.startsWith("2")){
if(level==1){
Expand All @@ -545,7 +545,7 @@ else if (element.startsWith("2")){
level2++;
String temp = element.substring(1);
element=level1+"."+level2+" "+temp;
directory = directory + "&nbsp;&nbsp;<a href=\"#"+temp.replaceAll(" ","_").replaceAll("[^a-zA-Z0-1_]","")+anchorext+"\" class=\"WikiTOC\">"+element+"</a><br>\n";
directory = directory + "&nbsp;&nbsp;<a href=\"#"+temp.replaceAll(" ","_").replaceAll("[^a-zA-Z0-9_]","")+anchorext+"\" class=\"WikiTOC\">"+element+"</a><br>\n";
}
else if (element.startsWith("1")) {
if (level>1) {
Expand All @@ -556,7 +556,7 @@ else if (element.startsWith("1")) {
level1++;
String temp = element.substring(1);
element=level1+". "+temp;
directory = directory + "<a href=\"#"+temp.replaceAll(" ","_").replaceAll("[^a-zA-Z0-1_]","")+anchorext+"\" class=\"WikiTOC\">"+element+"</a><br>\n";
directory = directory + "<a href=\"#"+temp.replaceAll(" ","_").replaceAll("[^a-zA-Z0-9_]","")+anchorext+"\" class=\"WikiTOC\">"+element+"</a><br>\n";
}
anchorext="";
}
Expand Down Expand Up @@ -594,7 +594,7 @@ private String pairReplace(String input, String pat, String repl1, String repl2)
doubles++;
}
}
String anchor = direlem.replaceAll(" ","_").replaceAll("[^a-zA-Z0-1_]",""); //replace blanks with underscores and delete everything thats not a regular character, a number or _
String anchor = direlem.replaceAll(" ","_").replaceAll("[^a-zA-Z0-9_]",""); //replace blanks with underscores and delete everything thats not a regular character, a number or _
//if there are doubles, add underscore and number of doubles plus one
if(doubles>0){
anchor = anchor + "_" + (doubles+1);
Expand Down

0 comments on commit 1965a8c

Please sign in to comment.