From mboxrd@z Thu Jan 1 00:00:00 1970 From: tftorrey@tftorrey.com (T.F. Torrey) Subject: Re: Bug: HTML export ignoring CUSTOM_ID properties Date: Sat, 18 Apr 2015 11:26:11 -0700 Message-ID: <877ft9cmyk.fsf@jack.tftorrey.com> References: <871tjhwnd0.fsf@gmx.us> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:42415) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YjXSB-00036b-Et for emacs-orgmode@gnu.org; Sat, 18 Apr 2015 14:26:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YjXS8-0000FN-8Y for emacs-orgmode@gnu.org; Sat, 18 Apr 2015 14:26:55 -0400 Received: from relay3-d.mail.gandi.net ([2001:4b98:c:538::195]:33059) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YjXS7-0000F2-VQ for emacs-orgmode@gnu.org; Sat, 18 Apr 2015 14:26:52 -0400 In-Reply-To: <871tjhwnd0.fsf@gmx.us> (message from Rasmus on Sat, 18 Apr 2015 15:57:15 +0200) 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: Rasmus Cc: emacs-orgmode@gnu.org Hello Rasmus, Rasmus writes: >>>> With the latest from Git master, the HTML export ignores CUSTOM_ID >>>> properties for subtrees. I've seen list traffic that the names of the >>>> export ID's are being changed, but this is not intentional, right? >>> >>> It doesn't ignore it, but it is translate to a generic anchor as >>> needed. >> >> Isn't translating it to a generic anchor the same as ignoring it? >> Without a CUSTOM_ID you get a generic anchor. With a CUSTOM_ID you get >> a generic anchor. > > You click it and it still works. It's not ignored. Within the syntax it > does the right thing. > >> Because I know (knew) the id of the section about Clinton, I could link >> to my page from another document outside Org with a link to >> presidents.html#clinton. > > Presumably you could use presidents.org::#clinton still. Links may work from inside Org, but the original intent of CUSTOM_ID was to produce a stable ID for the HTML export that could be linked to from outside Org. With the changed functionality, all existing links to presidents.html#clinton are broken, because the usage of CUSTOM_ID has changed. Any custom CSS is also broken, for the same reason. With the new usage, CUSTOM_ID and ID have virtually the same functionality. >> Notice how my CUSTOM_ID's are no longer ID's at all. And simply adding >> "text-" to my CUSTOM_ID's is not an answer. For one thing, CUSTOM_ID >> exports should not change on the breeze of developer whims. For >> another, the ID should be attached to the heading, not the body of the >> text; otherwise, a person following the link would have no idea if it >> went to the Clinton section or not. >> >> Note that this also breaks any CSS styling for the section with the >> CUSTOM_ID (which I also use). If I used a CUSTOM_ID because wanted a >> swanky background for the heading saying "Bill Clinton", the current >> export not only doesn't use that ID, it doesn't encompass the heading >> with his name in. > > I have a half-baked patch that restores the old behavior, but I have to > think a bit more about it, and I won't have time today. Nicolas might > also see it in the coming days. E.g. ox-latex has org-latex--label. The > question is whether there should be a solution in ox or whether each > backend should have org-BACKEND--label. As the current state is unusable, there would be no additional harm in applying your half-baked patch. >>> Thus, I think it is a bug, unless there is a better way to allow >>> per-section css. I will look at this later unless somebody beets me to it. >> >> Given the lack of outcry, I may be the only one using CUSTOM_ID's for >> HTML export. However, if usage is widespread enough and accidental >> duplicates are a problem enough that this needs to be addressed, >> wouldn't it be better for the exporter to simply report duplicate ID's >> as they are found? > > It was changed this week. Either no one is using it according to its original intended functionality, no one has republished their HTML documents with the latest from git, or people have simply not noticed that their links are broken. >> Finally, given that this doesn't appear to work at all in any form of >> its intended usage, how did this even get committed to master? Sure, >> code in master may have bugs, but this is more than a bug; this is >> unusable code that breaks code that worked. Shouldn't it be developed >> on a feature branch or in someone's private repo until it actually >> works? > > Master is where we develop things. The code on master is *supposed* to work as advertised. It identifies itself as 8.3 beta. Changes that break functionality in exploratory ways are alpha changes. > Nicolas made the change and he's off this week. Feel free to use Org > 8.2. Ha ha. There are many tools capable of exporting plain-text documents to HTML with predictable and stable ID's. If Org 8.3 is not going to be one of them, using Org 8.2 is not a solution. >> Unless there is a quick fix that restores external (non-Org-generated) >> links to sections with CUSTOM_ID's, please revert these changes until >> the development reaches a usable state. > > Won't happen. As you said, they aren't your changes and it isn't your decision. Best, Terry -- T.F. Torrey