Showing 2 changed files with 4 additions and 4 deletions
+2 -2
templates/blob.html.ep
... ...
@@ -106,8 +106,8 @@
106 106
       % if ($file =~ /\.md$/) {
107 107
         <%
108 108
           my $readme = join "\n", @$lines;
109
-          $readme =~ s#^(\[.*\]:)(?!\s*https?://)\s*(\S*)#$1 /$user/$project/raw/$rev/$2#mg;
110
-          $readme =~ s#^(!\[.*\]\()(?!https?://)(\S*)#$1/$user/$project/raw/$rev/$2#mg;
109
+          $readme =~ s#^(\[.*\]:)(?!\s*https?://)\s*(\S*)#{"$1 " . url_for("/$user/$project/raw/$rev/$2")}#mge;
110
+          $readme =~ s#^(!\[.*\]\()(?!https?://)(\S*)#{$1 . url_for("/$user/$project/raw/$rev/$2")}#mge;
111 111
           my $readme_e = Text::Markdown::Hoedown::markdown($readme, extensions => HOEDOWN_EXT_FENCED_CODE);
112 112
         %>
113 113
         <div class="readme-frame">
+2 -2
templates/include/readme.html.ep
... ...
@@ -22,8 +22,8 @@
22 22
     if ($lines) {
23 23
       $type = 'markdown';
24 24
       my $readme = join "\n", @$lines;
25
-      $readme =~ s#^(\[.*\]:)(?!\s*https?://)\s*(\S*)#$1 /$user/$project/raw/$rev/$2#mg;
26
-      $readme =~ s#^(!\[.*\]\()(?!https?://)(\S*)#$1/$user/$project/raw/$rev/$2#mg;
25
+      $readme =~ s#^(\[.*\]:)(?!\s*https?://)\s*(\S*)#{"$1 " . url_for("/$user/$project/raw/$rev/$2")}#mge;
26
+      $readme =~ s#^(!\[.*\]\()(?!https?://)(\S*)#{$1 . url_for("/$user/$project/raw/$rev/$2")}#mge;
27 27
       $readme_e = Text::Markdown::Hoedown::markdown($readme, extensions => HOEDOWN_EXT_FENCED_CODE);
28 28
     }
29 29
   }