From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michel Damiens Subject: 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 00:12:30 +0100 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000ce17d30565202286" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:36429) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eljl2-0002FO-0g for emacs-orgmode@gnu.org; Tue, 13 Feb 2018 18:13:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eljl0-0002PG-FT for emacs-orgmode@gnu.org; Tue, 13 Feb 2018 18:13:03 -0500 Received: from mail-pl0-x232.google.com ([2607:f8b0:400e:c01::232]:45976) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eljl0-0002Os-6D for emacs-orgmode@gnu.org; Tue, 13 Feb 2018 18:13:02 -0500 Received: by mail-pl0-x232.google.com with SMTP id p5so7406083plo.12 for ; Tue, 13 Feb 2018 15:13:01 -0800 (PST) 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: emacs-orgmode@gnu.org --000000000000ce17d30565202286 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Remember to cover the basics, that is, what you expected to happen and what in fact did happen. You don't know how to make a good report? See https://orgmode.org/manual/Feedback.html#Feedback Your bug report will be posted to the Org mailing list. ------------------------------------------------------------------------ Hello, 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)
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 with = a blank line ? (Sorry, I didn't find in documentation a way to format code in the mail. I hope it is readable) Thanks a lot for your help Michel Emacs : GNU Emacs 24.5.1 (x86_64-pc-linux-gnu, GTK+ Version 3.18.9) of 2017-09-20 on lcy01-07, modified by Debian Package: Org mode version 9.1.6 (9.1.6-44-ge6f891-elpa @ /home/michel/.emac= =3D s.d/elpa/org-20180212/) --000000000000ce17d30565202286 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


Remember to cover the basics, that is, what you expect= ed to happen and
what in fact did happen.=C2=A0 You don't know how t= o make a good report?=C2=A0 See

=C2=A0 =C2=A0 =C2=A0https://orgmode.org/manual/Fe= edback.html#Feedback

Your bug report will be posted to the Org m= ailing list.
-----------------------------------------------------------= -------------

Hello,
When exporting to html an image for which I = added a class attribute, the
result seems to depend on the fact that I i= nsert or not an empty line
after the image link. Example :

with t= his text in my org file :

=C2=A0 =C2=A0 * Le sens des math
=C2=A0= #+ATTR_HTML: :class vignette
=C2=A0 =C2=A0 [[file:logo_utl.jpg]]

= =C2=A0 =C2=A0 [[file:utltb.org][UTL-TB]]=C2=A0 =C2=A0 (Universit=C3=A9 du Temps Libre de Tarbes et Bigorre)
I get the following html code :

=C2=A0 =C2=A0 <div id=3D"o= utline-container-org4aefefe" class=3D"outline-2">
=C2= =A0 =C2=A0 =C2=A0 =C2=A0 <h2 id=3D"org4aefefe">Le sens des = math</h2>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 <div class=3D"outlin= e-text-2" id=3D"text-org4aefefe">
=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 <figure>
=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 = <img src=3D"logo_utl.jpg" alt=3D"logo_utl.jpg" class=3D"vignette">
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 <br>
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 </figure>
=C2=A0 =C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 <p>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 <a hr= ef=3D"utltb.html">UTL-TB</a>
=C2=A0 =C2=A0 <br&g= t;(Universit=C3=A9 du Temps Libre de Tarbes et Bigorre)<br>

an= d with this text (no blank line in the middle) :

=C2=A0 =C2=A0 * Le = sens des math
#+ATTR_HTML: :class vignette
=C2=A0 =C2=A0 [[file:logo= _utl.jpg]]
=C2=A0 =C2=A0 [[file:utltb.org][UTL-TB]]
=C2=A0 =C2=A0 (Universit=C3=A9 du Temps Libre de Tarbes et = Bigorre)

I get :

=C2=A0 =C2=A0 div id=3D"outline-contain= er-org4aefefe" class=3D"outline-2">
=C2=A0 =C2=A0 <= ;h2 id=3D"org4aefefe">Le sens des math</h2>
=C2=A0 = =C2=A0 <div class=3D"outline-text-2" id=3D"text-org4aefe= fe">
=C2=A0 =C2=A0 <p class=3D"vignette">
=C2=A0 =C2=A0 <img= src=3D"logo_utl.jpg" alt=3D"logo_utl.jpg" class=3D"vignette"><= br>=C2=A0 =C2=A0 <br>
=C2=A0 =C2=A0 <a href=3D"utltb.h= tml">UTL-TB</a>
=C2=A0 =C2=A0 <br>(Universit=C3=A9= du Temps Libre de Tarbes et Bigorre)<br>
=C2=A0

In the sec= ond case the class attribute have been added both to <p> and
<i= mg> tags, which is not what I xant.
Is it always necessary to separat= e the link from the rest of the text with a
blank line ?

(Sorry, = I didn't find in documentation a way to format code in the
mail. I h= ope it is readable)

Thanks a lot for your help

Michel

= Emacs =C2=A0: GNU Emacs 24.5.1 (x86_64-pc-linux-gnu, GTK+ Version 3.18.9)=C2=A0of 2017-09-20 on lcy01-07, modified by Debian
Package: Org mode = version 9.1.6 (9.1.6-44-ge6f891-elpa @ /home/michel/.emac=3D
s.d/elpa/or= g-20180212/)
--000000000000ce17d30565202286-- 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