Browse Source

eclipse plugin: Fix pointing to different files

Samuel Thibault 3 years ago
parent
commit
c86d4ec7be
1 changed files with 4 additions and 4 deletions
  1. 4 4
      eclipse-plugin/src/starpu/handlers/SvgHandler.java

+ 4 - 4
eclipse-plugin/src/starpu/handlers/SvgHandler.java

@@ -54,10 +54,10 @@ public class SvgHandler extends AbstractHandler {
 				else
 				{
 					String map = TraceUtils.readFileToString(workDir + "/output.map");
-					Pattern p = Pattern.compile("href=\"[^#\"]+#");
-					IPath ipath = ((IPathEditorInput) input).getPath().makeAbsolute();
-					String chemin = ipath.toString();
-					String replaceBy = "href=\"" + chemin + "#";
+					Pattern p = Pattern.compile("href=\"([^#\"/]+/)*");
+					IPath ipath = ((IPathEditorInput) input).getPath().makeAbsolute().removeLastSegments(1);
+					String path = ipath.toString();
+					String replaceBy = "href=\"" + path + "/";
 					map = p.matcher(map).replaceAll(replaceBy);
 
 					PrintWriter pw = new PrintWriter(workDir + "/output.html");