search parent of parent
@@ -184,7 +184,15 @@ public class RefUtils {
} else {
String url = file;
if (url.contains("..")) {
- url = parentDirectory + url.substring(url.indexOf(".") + 2);
+ int parentCount = 0;
+ while (url.contains("..")) {
+ url = url.substring(url.indexOf(".") + 2);
+ parentCount++;
+ }
+ for (int i = 0; i < parentCount - 1; i++) {
+ parentDirectory = parentDirectory.getParent();
+ }
+ url = parentDirectory + url;
} else {
url = parentDirectory + url.substring(url.indexOf(".") + 1);
}
