bytesparadise / libasciidoc

A Golang library for processing Asciidoc files.
Apache License 2.0
202 stars 24 forks source link

include fails with absolute paths #1109

Open DavidGamba opened 1 year ago

DavidGamba commented 1 year ago

Given a test file:

= Test

[source, adoc]
----
include::include.adoc[]
----

[source, adoc]
----
include::../include.adoc[]
----

[source, adoc]
----
include::/tmp/include.adoc[]
----

and a simple setup:

$ echo hello > include.adoc

$ echo hello > /tmp/include.adoc

$ echo hello > ../include.adoc

rendering fails with the following error:

libasciidoc test.adoc 
Error: Unresolved directive in test.adoc - include::/tmp/include.adoc[]: chdir /Users/davidgamba/test/asciidoc-absolute-vs-relative/tmp: no such file or directory
Unresolved directive in test.adoc - include::/tmp/include.adoc[]: chdir /Users/davidgamba/test/asciidoc-absolute-vs-relative/tmp: no such file or directory