atom-asciidoc-preview icon indicating copy to clipboard operation
atom-asciidoc-preview copied to clipboard

Missing support for block images

Open stefanpaal opened this issue 6 years ago • 5 comments

Description

Images can be positioned as inline or block image. While inline images are correctly shown in the asciidoc preview window, block images are not. When I publish the asciidoc document to PDF, e.g. by using asciidoctor, the image appears in the PDF document as block image.

  • Atom version: 1.11.2
  • OS: Linux Mint 18.3
  • asciidoc-preview version: 2.9.2
  • language-asciidoc version: 1.6.2

Syntax example

Inline images defined as below are shown in the asciidoc-preview window:

image:MyImage.png[]

Block images defined as below are NOT shown in the asciidoc-preview window but the statement is shown:

image::MyImage.png[]

References

https://asciidoctor.org/docs/asciidoc-syntax-quick-reference/#images https://github.com/asciidoctor/docker-asciidoctor

stefanpaal avatar Apr 29 '18 10:04 stefanpaal

Hello, I don't reproduce your issue.

Block images and inline images are both supported.

I recommend to you to update:

  • your Atom (current is 1.26)
  • the asciidoc-preview package (current is 2.11)
  • the language-asciidoc package (current is 1.11)

ldez avatar Apr 29 '18 12:04 ldez

Ah, you are right. I missed something in my issue description above. Actually, I have a space in the file name between "My" and "Image", meaning My Image.png. After poking a bit, I realized that block images are basically supported but not for file names containing a space. Somehow the parsing of the file name fails. If I use the same file name (with space) for an inline image, it works. As a workaround, I now use underscores instead of spaces.

Thank you for the hint to update Atom. Just did it but the parsing of file names containing spaces still fails for block images. Sorry for having bothered you, I can also live with the workaround using underscores :-)

stefanpaal avatar Apr 29 '18 12:04 stefanpaal

You can encode the path of your image like that:

image::My%20Image.png[alt]

e.g. replace by %20

ldez avatar Apr 29 '18 12:04 ldez

Yeah but then the PDF generation with asciidoctor fails with image not found error as it probably does not substitute %20 with a space. The workaround using underscores instead of spaces works for atom-asciidoc-preview and asciidoctor.

stefanpaal avatar Apr 29 '18 12:04 stefanpaal

This will be resolved once the upgrade to 1.5.6 is complete as spaces are now permitted by the core processor.

mojavelinux avatar Apr 29 '18 19:04 mojavelinux