From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou 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 21:19:53 +0100 Message-ID: <8760xc1r12.fsf@nicolasgoaziou.fr> References: <56CE5C4D.5090100@aaron-miller.me> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:48408) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aZ2MC-0001m9-LT for emacs-orgmode@gnu.org; Thu, 25 Feb 2016 15:17:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aZ2M9-0004q9-T1 for emacs-orgmode@gnu.org; Thu, 25 Feb 2016 15:17:52 -0500 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:48168) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aZ2M9-0004q3-MG for emacs-orgmode@gnu.org; Thu, 25 Feb 2016 15:17:49 -0500 In-Reply-To: <56CE5C4D.5090100@aaron-miller.me> (Aaron Miller's message of "Wed, 24 Feb 2016 20:43:41 -0500") 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Aaron Miller Cc: emacs-orgmode@gnu.org Hello, Aaron Miller writes: > Expected: When exporting an Org document with named source blocks to > HTML, each
 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 ---
> 
> ;; hi
> 
> --- 8< cut here --- > > Actual result (its likewise): > --- >8 cut here --- >
> ;; hi
> 
> --- 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