Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inline images in the preview aren't working. #901

Open
BcOleks opened this issue Sep 12, 2024 · 3 comments
Open

Inline images in the preview aren't working. #901

BcOleks opened this issue Sep 12, 2024 · 3 comments
Labels

Comments

@BcOleks
Copy link

BcOleks commented Sep 12, 2024

Hi,

I am trying to preview an inline image using the extension, but the image does not get the correct path in the <img src="..."> attribute. It only gets <img src="image.png"> instead of the full path like <img src="fullPath/image.png">, as it does with block images.

Please see the screenshot for reference:

Inline image (image:image.png[])
Block image (image::image.png[])

Is this a known issue, and is it on the roadmap to be fixed? I apologize if this is a duplicated issue.

Thank you for your assistance.

image

@ggrossetie
Copy link
Member

Hey, could you please share a sample document that reproduce this issue. Do you explicitly define :imagesdir:?

@BcOleks
Copy link
Author

BcOleks commented Sep 23, 2024

Hi @ggrossetie I will add the testmodule in which you will find page which represent the issue.

I have this module at path:
../documentation/docs/modules/testmodule

Where documentation is my repository and /docs/modules is Antora default dir for pages content.

The repository structure looks like this:

|-- documentation
|   |-- docs
|   |   |-- modules
|   |   |   |-- ROOT
|   |   |   |   |-- images
|   |   |   |   |   |-- tmp
|   |   |   |   |   |   |-- tmp.png
|   |   |   |   |-- pages
|   |   |   |   |   |-- tmp
|   |   |   |   |   |   |-- index.adoc
|   |   |   |   |   |-- index.adoc
|   |   |   |   | -- nav.adoc
|   |   |   |-- testmodule
|   |   |   |   |-- images
|   |   |   |   |   |-- test
|   |   |   |   |   |   |-- test-image.png
|   |   |   |   |-- pages
|   |   |   |   |   |-- test
|   |   |   |   |   |   |-- index.adoc
|   |   |   |   | -- nav.adoc
|   |   |-- antora.yml

Here is a content of index.adoc from testmodule:

= Test page

== Peoples

== What we do

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor image:test/test-image.png[width=1200] incididunt ut labore et dolore magna aliqua.

Here is a content of antora.yml:

name: documentation
title: Documentation
start_page: index.adoc
nav:
  - modules/ROOT/nav.adoc
  - modules/testmodule/nav.adoc

Here is a content of nav.adoc from testmodule:

* Test
** xref:test/index.adoc[]

The content of ROOT folder is not important because there is no issue with it. I will include only testmodule in tar.gz where you can find a page with issue (testmodule/pages/test/index.doc) and images dir for it - so you can check it, just include the folder testmodule into your modules directory.

Description of issue:

There is only one inline image on page and when it rendered i get such <img> definition in html - the src have incorrect path:
<p><span class="image"><img src="test/test-image.png" alt="test image" width="1200"></span></p>

But when I replace it with block image I will get a correct path:
<img src="/Users/username/Documents/documentation/docs/modules/testmodule/images/test/test-image.png" alt="test-image" width="1200">

No I do not define :imagesdir: explicitly - just use default value.

If you need any further information please let me know.

testmodule.tar.gz

@BcOleks
Copy link
Author

BcOleks commented Nov 8, 2024

Hi @ggrossetie, I hope you're doing well. I wanted to follow up and ask if there are any updates on this. Thank you in advance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants