From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Bug: html export : adding a class attribute to an image [9.1.6 (9.1.6-44-ge6f891-elpa @ /home/michel/.emacs.d/elpa/org-20180212/)] Date: Wed, 14 Feb 2018 15:07:39 +0100 Message-ID: <87d117psus.fsf@nicolasgoaziou.fr> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:57454) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1elxit-0005Ik-F5 for emacs-orgmode@gnu.org; Wed, 14 Feb 2018 09:07:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1elxip-0002oA-9I for emacs-orgmode@gnu.org; Wed, 14 Feb 2018 09:07:47 -0500 Received: from relay4-d.mail.gandi.net ([2001:4b98:c:538::196]:52460) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1elxip-0002nf-31 for emacs-orgmode@gnu.org; Wed, 14 Feb 2018 09:07:43 -0500 In-Reply-To: (Michel Damiens's message of "Wed, 14 Feb 2018 00:12:30 +0100") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Michel Damiens Cc: emacs-orgmode@gnu.org Hello, Michel Damiens writes: > When exporting to html an image for which I added a class attribute, the > result seems to depend on the fact that I insert or not an empty line > after the image link. Example : > > with this text in my org file : > > * Le sens des math > #+ATTR_HTML: :class vignette > [[file:logo_utl.jpg]] > > [[file:utltb.org][UTL-TB]] > (Universit=C3=A9 du Temps Libre de Tarbes et Bigorre) > > I get the following html code : > >
>

Le sens des math

>
>
> 3D"logo_utl.jpg" >
>
>

> UTL-TB >
(Universit=C3=A9 du Temps Libre de Tarbes et Bigorre)
> > and with this text (no blank line in the middle) : > > * Le sens des math > #+ATTR_HTML: :class vignette > [[file:logo_utl.jpg]] > [[file:utltb.org][UTL-TB]] > (Universit=C3=A9 du Temps Libre de Tarbes et Bigorre) > > I get : > > div id=3D"outline-container-org4aefefe" class=3D"outline-2"> >

Le sens des math

>
>

> 3D"logo_utl.jpg" >
> UTL-TB >
(Universit=C3=A9 du Temps Libre de Tarbes et Bigorre)
Off-topic: Nice organization! I wish I had heard about it when I was living in Tarbes. > In the second case the class attribute have been added both to

and > tags, which is not what I xant. > Is it always necessary to separate the link from the rest of the text wit= h a > blank line ? It is an Org limitation, which doesn't have proper syntax for images attributes.=20 More specifically, any paragraph containing only a link to an image file is a stand-alone image. Org, whenever it encounters one of them, applies paragraph attributes to the image instead, as in your first example. On the other hand, when the paragraph contains anything else, attributes go to the paragraph itself, as in the second example. The fact that the first image still gets the attribute is more surprising, and could be considered as a bug, but, AFAIU, this is not what your report is about. Long story short: you cannot set attributes to multiple images within a single paragraph. You need to insert one image per paragraph, or write raw HTML code within the Org buffer. Regards, --=20 Nicolas Goaziou