asciidoctor / atom-asciidoc-preview

⚛ AsciiDoc preview for the Atom editor.
https://atom.io/packages/asciidoc-preview
MIT License
142 stars 42 forks source link

Missing support for block images #267

Open stefanpaal opened 6 years ago

stefanpaal commented 6 years ago

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.

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

ldez commented 6 years ago

Hello, I don't reproduce your issue.

Block images and inline images are both supported.

I recommend to you to update:

stefanpaal commented 6 years ago

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 :-)

ldez commented 6 years ago

You can encode the path of your image like that:

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

e.g. replace ` by%20`

stefanpaal commented 6 years ago

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.

mojavelinux commented 6 years ago

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