Fix bug #44: fix anchors of files with spaces in their name
authorChristian Weiske <cweiske@cweiske.de>
Tue, 19 Nov 2013 17:04:25 +0000 (18:04 +0100)
committerChristian Weiske <cweiske@cweiske.de>
Tue, 19 Nov 2013 17:04:25 +0000 (18:04 +0100)
data/templates/display-file.htm

index 8a25506..ee3a3c2 100644 (file)
@@ -4,7 +4,7 @@
   {% for toolinfo in file.getToolInfos %}
   <a class="btn btn-mini" href="{{toolinfo.getLink(file)}}" style="float: right;">{{toolinfo.getTitle}}</a>
   {% endfor %}
-  <h3 id="{{file.getFilename}}">{{file.getFilename}}<a class="anchorlink" href="#{{file.getFilename}}"></a></h3>
+  <h3 id="{{file.getFilename|replace({' ': '-'})}}">{{file.getFilename}}<a class="anchorlink" href="{{repo.getLink('display')}}#{{file.getFilename|replace({' ': '-'})}}"></a></h3>
  </div>
   {{file.getRenderedContent(toolres)|raw}}
 </div>