We are currently planning to migrate to a different platform for the forum. We will announce this fact both here and on Twitter, once we have settled on a solution.

[BUG] Textbundle export fails to include image files

edited April 10 in General

Crossposted at GitHub

Issue

When exporting to textbundle, no images are included in the assets folder and links are rewritten to point to the current folder (not the assets folder).

Background

  • I'm on macOS 10.15.4, Zettlr 1.6, and pandoc 2.9.2.1
  • All image files are in the same folder as the .md files
  • All images show up fine in Zettlr's Editor (and Marked app, MMDC, etc etc)
  • All image links are relative and in this format: ![](image.jpg)
    • I have tried other relative linking like /image.jpg and ./image.jpg. All of these links also show up in the Editor, but still none of the images export

Description

  • Exported image links are rewritten to absolute paths /Users/UserAcct/Path/To/Folder/image.jpg and contain no reference to the assets folder as expected for textbundle
  • I URL escape all my image links, but the rewritten image links are unescaped (not sure if this matters, but including it just in case)
  • I've tried exporting to the temp dir as well as the working dir but neither export properly
  • This seems to be happening with .textpack files too
  • I haven't tested exporting to PDF yet, but exporting to .docx works fine (all images are included)

I think that sums it up. Lemme know if I forgot anything, if I can test anything, or if I've made some boneheaded error!

Tagged:

Comments

  • I already saw your issue on the issue tracker, and I'll be looking into it!

  • I was experiencing the same issue and here's what I observed and how I solved it...

    When Zettlr exports to .texbundle, it converts relative image paths to absolute paths.

    My .textbundle Assets folder was empty, as described above. So I opened the .md file in the .textbundle package and had a look to see what had gone wrong.

    The absolute image path links were broken.

    Turns out that in one of the folders in the path I had text in brackets in the folder name. For example:

    Parent
    Subfolder (my text)
    Markdown
    images

    The absolute path broke at the left-hand bracket in the second subfolder. Seems it was expecting an escape - since it is a bracket - but you cannot have an escape character in a folder name, of course.

    So I removed the brackets in the folder name, for example:

    Parent
    Subfolder - my text
    Markdown
    images

    Zettlr had no problem with the hyphen instead of the bracket and the .textbundle was created with the images in the Assets folder as it should. Case solved.

    AS AN ASIDE:

    I would much rather have relative paths in a .textbundle that absolute paths. The reason being that any folder reorganisation on the Mac will break the path links in the textbundles. Is there a way of doing this?

    Cheers,
    Colin

  • Seems it was expecting an escape

    No, that's not it, as Zettlr doesn't require escaping any characters … it's more likely that you're using the 1.6, right? Because I already addressed that issue (there were bugs in the algorithm that converted absolute to relative filenames), but they're currently only applied in the recent beta releases!

    I would much rather have relative paths in a .textbundle that absolute paths.

    That is how it's supposed to be (according to the official specifications) — so if the image paths inside your markdown file in a textbundle do not begin with assets/ that's clearly a bug and not intended behaviour!

  • edited June 2

    Yes, I am using 1.6.0 (where can I get the latest version?). 1.6.0 is what downloads from the website.

    I'll run more tests and report back. Cheers.

  • where can I get the latest version?

    The beta versions are offered on the repository: https://github.com/Zettlr/Zettlr/releases

  • edited June 2

    Thanks, Hendrik. I shall report back. Cheers.

  • I have tied 1.7.8 and now I cannot export to a textbundle (or any other format). Export shows the dialog, I select the format, and the dialog is dismissed. But no export file is created.

  • Export shows the dialog, I select the format, and the dialog is dismissed. But no export file is created.

    Well, that's not good. Is any error or something in the logs shown?

Sign In or Register to comment.