Closed ahus1 closed 10 months ago
As your preview comment was an old issue, I moved it to to a new issue.
It seems to me that you are mixing block macros (two colons ::
) with inline macros (one colon :
) - see here for examples: https://docs.asciidoctor.org/asciidoc/latest/macros/images/#inline-image-macro
A block macro must be on a block of its own. This means it usually has a blank line before and after. Still, it might have a title or an ID which would be part of that block. It is not enough to put it just on a single line.
So the following will work if it is on its own block:
some text
image::trigger-actions.png[]
some text
If you have an enumeration, and want to have the block macro image part of the enumeration, use a list continuation +
- https://docs.asciidoctor.org/asciidoc/latest/lists/continuation/#list-continuation
. First list item
+
image::trigger-actions.png[]
. Another list item
In the output (and preview), you'll notice that without the +
the image will start at the beginning of the line. With the +
, it will have the same indentation as the list item.
I assume this answers your question. I'll therefore close this issue. Please comment if you have additional questions.
Hello,
Thanks for Precision. I think it explain my issue. But I guess it can be improved with 2 points:
I used Paste (ctrl+v) command to insert image. Then code generated automatically could, either insert it in inline syntax, either adding a "enter" before and after it. It's currently putting macro on a new line as block, but without the extra blank line.
As second point, my renderer (Antora) is anyway displaying correctly image (even if as you said, syntax is not following standard). I would prefer that Plugin preview tolerate that.
Hello @ahus1, I'm having a similar issue. Observed vs. expected behavior
image::
is not recognized in syntax view and in preview:image:
is workinghow to reproduce :
header of mypage.adoc
:imagesdir: ../images/
preview only works for image: and not image::
thanks for correction.
Env info
PhpStorm 2023.3.1 Build #PS-233.11799.297, built on December 11, 2023 Runtime version: 17.0.9+7-b1087.7 amd64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o. Windows 11.0 org.asciidoctor.intellij.asciidoc (0.41.2) net.antelle.intellij-xcode-dark-theme (1.2.4)
Originally posted by @abonne01-pro in https://github.com/asciidoctor/asciidoctor-intellij-plugin/issues/1366#issuecomment-1864271243