File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -243,7 +243,7 @@ private static String replaceImageLinkPath(Project project, String text){
243243 if (StringUtils .isNotEmpty (root )) {
244244 root = "/" + root ;
245245 }
246- final String imageLink = "!\\ [(?<text>[^\\ ]]*)\\ ]\\ (\\ /?(?!https\\ :|http\\ :|ftp\\ :|file\\ :) (?<link>[^ \\ )] *)\\ )" ;
246+ final String imageLink = "!\\ [(?<text>[^]]*)]\\ (/?(?!https:|http:|ftp:|file:)[.][/] (?<link>. *)\\ )" ;
247247 return text .replaceAll (imageLink , ".replaceAll ("refs/heads/" , "" ) + "/$2)" );
248248 }
249249
@@ -252,8 +252,8 @@ private static String replaceContentsLinkToCodeBrowerPath(Project project, Strin
252252 if (StringUtils .isNotEmpty (root )) {
253253 root = "/" + root ;
254254 }
255- final String imageLink = "!\\ [(?<text>[^\\ ]]*)\\ ]\\ (\\ /?(?!https\\ :|http\\ :|ftp\\ :|file\\ :) (?<link>[^ \\ )] *)\\ )" ;
256- final String normalLocalLink = "(?<space>[^!])\\ [(?<text>[^\\ ]]*)\\ ]\\ (\\ /?(?!https\\ :|http\\ :|ftp\\ :|file\\ :) (?<link>[^ \\ )] *)\\ )" ;
255+ final String imageLink = "!\\ [(?<text>[^]]*)]\\ (/?(?!https:|http:|ftp:|file:)[.][/] (?<link>. *)\\ )" ;
256+ final String normalLocalLink = "(?<space>[^!])\\ [(?<text>[^]]*)]\\ (/?(?!https:|http:|ftp:|file:)[.][/] (?<link>. *)\\ )" ;
257257 String imageFilteredText = text .replaceAll (imageLink , ".replaceAll ("refs/heads/" , "" ) + "/$2)" );
258258 return imageFilteredText .replaceAll (normalLocalLink , "$1[$2](/" + root + project .owner + "/" + project .name + "/code/" + project .defaultBranch ().replaceAll ("refs/heads/" , "" ) + "/$3)" );
259259
You can’t perform that action at this time.
0 commit comments