emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Aaron Miller <me@aaron-miller.me>
To: Nicolas Goaziou <mail@nicolasgoaziou.fr>
Cc: "emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>
Subject: Re: Bug: HTML export fails to set source IDs correctly [8.3.4 (8.3.4-elpa @ /Users/aaron/.emacs.d/elpa/org-20160222/)]
Date: Thu, 25 Feb 2016 16:38:58 -0500	[thread overview]
Message-ID: <3E78538B-202B-4EC5-9E4C-B674279187C6@aaron-miller.me> (raw)
In-Reply-To: <8760xc1r12.fsf@nicolasgoaziou.fr>

[-- Attachment #1: Type: text/plain, Size: 2157 bytes --]

The difficulty here is that ID attribute values are not easily predictable, and dependent on the source block's position in the document. This complicates tasks like styling a specific source block -- with the previous ID generation method, this could be reliably done with an ID selector; with the current behavior, that's no longer true. 

Can you provide some insight on why the behavior was changed? I'd be happy to expand the scope of my bug report to cover whatever code relies on the change. Thanks!

--
Aaron Miller
Mobile: (443) 902-4702
me@aaron-miller.me
http://aaron-miller.me

> On Feb 25, 2016, at 15:19, Nicolas Goaziou <mail@nicolasgoaziou.fr> wrote:
> 
> Hello,
> 
> Aaron Miller <me@aaron-miller.me> writes:
> 
>> Expected: When exporting an Org document with named source blocks to 
>> HTML, each <pre> generated to contain a source block has an ID attribute 
>> matching the source block's name.
>> 
>> Actual: Instead, ID attributes come out with values like "orgsrcblock1".
>> 
>> Test case:
>> --- >8 cut here ---
>> #+TITLE: bug test case
>> 
>> #+NAME: a-source-block
>> #+BEGIN_SRC emacs-lisp :eval never
>> ;; hi
>> #+END_SRC
>> --- 8< cut here ---
>> 
>> Expected result (its salient subset):
>> --- >8 cut here ---
>> <pre class="src src-emacs-lisp" id="a-source-block">
>> ;; hi
>> </pre>
>> --- 8< cut here ---
>> 
>> Actual result (its likewise):
>> --- >8 cut here ---
>> <pre class="src src-emacs-lisp" id="orgsrcblock1">
>> ;; hi
>> </pre>
>> --- 8< cut here ---
>> 
>> Note the erroneous ID attribute value.
> 
> The attribute is intended.
> 
>> The issue here is that, in `org-html-src-block' and 
>> `org-html-inline-src-block', the fallback behavior for ID attribute 
>> value is implemented in terms of `and', rather than `or'. Since `and' 
>> short-circuits only when it encounters a null argument, the desired 
>> behavior is effectively inverted.
> 
> Actually this is the desired behaviour: when a label is specified, make
> sure to replace it with our internal unique and safe label. Hence the
> `and'.
> 
> 
> Regards,
> 
> -- 
> Nicolas Goaziou

[-- Attachment #2: Type: text/html, Size: 5213 bytes --]

  reply	other threads:[~2016-02-25 21:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-25  1:43 Bug: HTML export fails to set source IDs correctly [8.3.4 (8.3.4-elpa @ /Users/aaron/.emacs.d/elpa/org-20160222/)] Aaron Miller
2016-02-25 20:19 ` Nicolas Goaziou
2016-02-25 21:38   ` Aaron Miller [this message]
2016-02-27  8:38     ` Nicolas Goaziou
2016-02-28 16:00       ` Aaron Miller
2016-02-28 16:24         ` Nicolas Goaziou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3E78538B-202B-4EC5-9E4C-B674279187C6@aaron-miller.me \
    --to=me@aaron-miller.me \
    --cc=emacs-orgmode@gnu.org \
    --cc=mail@nicolasgoaziou.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).