]> granicus.if.org Git - multimarkdown/commitdiff
FIXED: Improve file path resolution with transclude base '.'
authorFletcher T. Penney <fletcher@fletcherpenney.net>
Fri, 21 Jul 2017 14:11:34 +0000 (10:11 -0400)
committerFletcher T. Penney <fletcher@fletcherpenney.net>
Fri, 21 Jul 2017 14:11:34 +0000 (10:11 -0400)
Sources/multimarkdown/main.c
tests/MMD6Tests/Transclusion.htmlc
tests/MMD6Tests/Transclusion.text

index 7b6bac41114b034e40abc9fe09054f8c7510639f..c4af7612b84dfbf1c4b1b79805184999e35bb7bb 100644 (file)
@@ -481,8 +481,12 @@ int main(int argc, char** argv) {
 
                if ((extensions & EXT_TRANSCLUDE) && (a_file->count == 1)) {
                        // Perform transclusion(s)
-                       mmd_transclude_source(buffer, folder, a_file->filename[0], format, NULL, NULL);
+            
+            // Convert to absolute path for first file to enable proper path resolution
+            char absolute[1025];
+            realpath(a_file->filename[0], absolute);
 
+            mmd_transclude_source(buffer, folder, absolute, format, NULL, NULL);
                        // Don't free folder -- owned by dirname
                }
 
index 42523971fb85f6ac29d7a69e94f45b6dc1c1f247..abcdbe1973dc088af94eaeeee8eaba3ed9759cdb 100644 (file)
@@ -1,5 +1,6 @@
 <p>Title:      Transclusion
-latex config:  article</p>
+latex config:  article
+transclude base: .</p>
 
 <p>{{foo.txt}}</p>
 
index ca8621962fb0a1a22ffabc1363d9d1ddf570a322..7f3ae17c2e4bdf186b9878338c34ec0480cdd44e 100644 (file)
@@ -1,5 +1,6 @@
 Title: Transclusion
 latex config:  article
+transclude base: .
 
 {{foo.txt}}