nitikiwi: fix `src_path` and stop losing the first character
authorJean Privat <jean@pryen.org>
Fri, 12 Jun 2015 15:41:05 +0000 (11:41 -0400)
committerJean Privat <jean@pryen.org>
Fri, 12 Jun 2015 23:21:10 +0000 (19:21 -0400)
Signed-off-by: Jean Privat <jean@pryen.org>

contrib/nitiwiki/src/wiki_base.nit

index 3e0f329..9cd3eb0 100644 (file)
@@ -550,8 +550,10 @@ class WikiArticle
        redef var src_full_path: nullable String = null
 
        redef fun src_path do
+               var src_full_path = self.src_full_path
                if src_full_path == null then return null
-               return src_full_path.substring_from(wiki.config.root_dir.length)
+               var res = wiki.config.root_dir.relpath(src_full_path)
+               return res
        end
 
        # The page markdown source content.