asciidocfx / AsciidocFX

Asciidoc Editor and Toolchain written with JavaFX 21 (Build PDF, Epub, Mobi and HTML books, documents and slides)
http://www.asciidocfx.com/
Apache License 2.0
1.86k stars 297 forks source link

Incorrect relative path when performing "paste converted" #647

Open 3rady opened 2 weeks ago

3rady commented 2 weeks ago

I am using AsciidocFX version 1.8.9 on Windows.

When using the "paste converted" function to add images to a document/project, AsciidocFX seems to be adding an extra (and incorrect) ../ (or go up one directory in the tree) prefix to the path of the image file. This does not seem to bother AsciidocFX, but when I use the same document with other tools (asciidoctor), the other tools do not accept the path.

Here is an example:

  1. Create a new folder C:\Temp\AsciidocFX-Test and set it as your work directory in AsciidocFX.
  2. Create a new document called Index.adoc in the work directory and open it.
  3. From another application, copy an image to the Windows clipboard.
  4. Right-click within the edit window for Index.adoc and select Paste converted.
  5. This creates folder C:\Temp\AsciidocFX-Test\images and places the new image file there, which is expected.
  6. For me, image::../images/Image-190624-032332.809.png[] was inserted into my document

I assert that the relative path to the image file from the Index.adoc's location should be images/Image-190624-032332.809.png (or ./images/Image-190624-032332.809.png). In order to get other tools to successfully process my documents, I must first manually edit the paths (to remove the extra ../ prefix) from all image files I have added, which is often quite a lot.

newbie-02 commented 3 days ago

see same behavior in linux ( debian ), not tested how other programs work with it, but path looks wrong. ver. 1.8.10