asciidoc-py / asciidoc-py2

Deprecated python2 implementation of AsciiDoc.py. See asciidoc-py/asciidoc-py for current work.
https://asciidoc.org/
GNU General Public License v2.0
466 stars 128 forks source link

Link in the title of an image break image rendering #129

Closed seinecle closed 6 years ago

seinecle commented 6 years ago

This line does not render an image in the html output:

image::server.jpg[align="center", title="https://www.oracle.com/servers/sparc/s7-2/index.html[A server]"]

Is my syntax wrong or are links not supported in image titles?

Note on the use case: I'd like to have the url source of the pics indicated as a link in the title of the image.

mojavelinux commented 6 years ago

Since this is a block image, you are better off writing it using the block notation.

.https://www.oracle.com/servers/sparc/s7-2/index.html[A server] image::server.jpg[align="center", book="keep"]

Asciidoctor supports the original syntax you posted, but AsciiDoc Python does not.

Cheers,

-Dan

On Mon, May 14, 2018 at 6:50 AM, Clement Levallois <notifications@github.com

wrote:

This line does not render an image in the html output:

image::server.jpg[align="center", title="https://www.oracle.com/ servers/sparc/s7-2/index.html[A server]", book="keep"]

Is my syntax wrong or are links not supported in image titles?

Note on the use case: I'd like to have the url source of the pics indicated as a link in the title of the image.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/asciidoc/asciidoc/issues/129, or mute the thread https://github.com/notifications/unsubscribe-auth/AAE19xO6hOe4d9TzCAQ3l73t34KsItppks5tyX2IgaJpZM4T9u0k .

-- Dan Allen | @mojavelinux | https://twitter.com/mojavelinux

seinecle commented 6 years ago

Thx! The block syntax works. For info the html rendering breaking with the syntax I posted originally was through the Atom plugin for previewing adocs.

mojavelinux commented 6 years ago

The Atom plugin was using a very old version of Asciidoctor. It was recently upgraded. Try upgrading now and see if it still works. If not, perhaps something is going on there that we need to address.

seinecle commented 6 years ago

indeed the plugins were outdated. All versions of the url-in-image-title syntax now work. Thanks for the extensive diagnostic!

lursel commented 4 years ago

The solution works only partially for me. I want to have a link as part of a wider sentence. I.e. something like "Click link:external[here] for more information". Adding more words breaks this solution:

Image of a .https://www.oracle.com/servers/sparc/s7-2/index.html[server]
image::server.jpg[align="center", book="keep"]

.Image of a https://www.oracle.com/servers/sparc/s7-2/index.html[server]
image::server.jpg[align="center", book="keep"]