Hi,

I've found an inconsistency in the way AsciiDoc treats relative paths
for image macros within included files.  It seems that if the image
macro is used at the end of the included file, the path is constructed
relative to the main (calling) document.  However, if there is
anything after the image macro other than a single line feed, then the
path is constructed relative to the included file.  I get this result
with AsciiDoc 8.6.6 under Win XP SP3 (using the data-uri attribute).

For example...

Directory structure:

\include-test\img\thumbsup.jpeg
\include-test\include\include-test-a.txt
\include-test\include-test.txt

include-test.txt:

= Include test

include::include/include-test-a.txt[]


include-test-a.txt:

.Thumbs up
image::img/thumbsup.jpeg[alt="thumbs up"]

.Thumbs up
image::img/thumbsup.jpeg[alt="thumbs up"]


This results in the first image not being found but the second being
included correctly.  The verbose output is:

asciidoc: reading: C:\bin\asciidoc-8.6.6\asciidoc.conf
asciidoc: reading: C:\bin\asciidoc-8.6.6\asciidoc.conf
asciidoc: reading: C:\asciidoc\include-test\include-test.txt
asciidoc: reading: C:\bin\asciidoc-8.6.6\xhtml11.conf
asciidoc: include1: C:\bin\asciidoc-8.6.6\stylesheets\asciidoc.css
asciidoc: include1: C:\bin\asciidoc-8.6.6\javascripts\asciidoc.js
asciidoc: reading: C:\bin\asciidoc-8.6.6\filters\code\code-filter.conf
asciidoc: reading: C:\bin\asciidoc-8.6.6\filters\graphviz\graphviz-
filter.conf
asciidoc: reading: C:\bin\asciidoc-8.6.6\filters\latex\latex-
filter.conf
asciidoc: reading: C:\bin\asciidoc-8.6.6\filters\music\music-
filter.conf
asciidoc: reading: C:\bin\asciidoc-8.6.6\lang-en.conf
asciidoc: writing: C:\asciidoc\include-test\include-test.xhtml
asciidoc: include-test.txt: line 1: evaluating: {template:toc}
asciidoc: include: C:\asciidoc\include-test\include\include-test-a.txt
asciidoc: include-test.txt: line 3: reading: C:\asciidoc\include-test
\include\include-test-a.txt
asciidoc: include-test-a.txt: line 2: evaluating:
{eval:os.path.splitext(r'img/thumbsup.jpeg')[1][1:]}
asciidoc: include-test-a.txt: line 2: evaluating:
{eval:os.path.join(r"C:\asciidoc\include-test\include",r"",r"img/
thumbsup.jpeg")}
asciidoc: include-test-a.txt: line 2: evaluating: {sys:python -uc
"import base64,sys; base64.encode(sys.stdin,sys.stdout)" < "C:\asciidoc
\include-test\include\img/thumbsup.jpeg"}
The system cannot find the path specified.
asciidoc: WARNING: include-test-a.txt: line 2: {sys:python -uc "import
base64,sys; base64.encode(sys.stdin,sys.stdout)" < "C:\asciidoc
\include-test\include\img/thumbsup.jpeg"}: non-zero exit status
asciidoc: include-test-a.txt: line 2: evaluating: {counter:figure-
number}
asciidoc: include-test-a.txt: line 5: evaluating:
{eval:os.path.splitext(r'img/thumbsup.jpeg')[1][1:]}
asciidoc: include-test-a.txt: line 5: evaluating:
{eval:os.path.join(r"C:\asciidoc\include-test",r"",r"img/
thumbsup.jpeg")}
asciidoc: include-test-a.txt: line 5: evaluating: {sys:python -uc
"import base64,sys; base64.encode(sys.stdin,sys.stdout)" < "C:\a
sciidoc\include-test\img/thumbsup.jpeg"}
asciidoc: include-test-a.txt: line 5: evaluating: {counter:figure-
number}


Am I doing something wrong here?  Any suggestions?

Cheers,
Will

-- 
You received this message because you are subscribed to the Google Groups 
"asciidoc" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/asciidoc?hl=en.

Reply via email to