From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 0HovMDebsmDiPQEAgWs5BA (envelope-from ) for ; Sat, 29 May 2021 21:51:19 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id IAuVKzebsmDhGwAAbx9fmQ (envelope-from ) for ; Sat, 29 May 2021 19:51:19 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 8F43F1EB9A for ; Sat, 29 May 2021 21:51:18 +0200 (CEST) Received: from localhost ([::1]:45228 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ln4zM-0004Nv-LS for larch@yhetil.org; Sat, 29 May 2021 15:51:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46868) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ln4yf-0004NU-LS for emacs-orgmode@gnu.org; Sat, 29 May 2021 15:50:34 -0400 Received: from relay7-d.mail.gandi.net ([217.70.183.200]:42723) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ln4yc-000638-P1 for emacs-orgmode@gnu.org; Sat, 29 May 2021 15:50:33 -0400 Received: (Authenticated sender: admin@nicolasgoaziou.fr) by relay7-d.mail.gandi.net (Postfix) with ESMTPSA id 5243120002; Sat, 29 May 2021 19:50:25 +0000 (UTC) From: Nicolas Goaziou To: sbaugh@catern.com Subject: Re: HTML export uses anchor ids which change on every export References: <87wnrhl7z7.fsf@catern.com> Mail-Followup-To: sbaugh@catern.com, emacs-orgmode@gnu.org Date: Sat, 29 May 2021 21:50:24 +0200 In-Reply-To: <87wnrhl7z7.fsf@catern.com> (sbaugh@catern.com's message of "Sat, 29 May 2021 14:18:04 -0400") Message-ID: <87bl8tz5dr.fsf@nicolasgoaziou.fr> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=217.70.183.200; envelope-from=mail@nicolasgoaziou.fr; helo=relay7-d.mail.gandi.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: emacs-orgmode@gnu.org Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1622317878; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=Y3oNkzzA+AK6g+LJxpeuqaIg8lyD/oHDekksS1lkevo=; b=JGxRIzBoRpancI+uL4YZBb9YMdc4uBXfKd9EZOBOjOcFzKBOyJZFYhDhQ65v25M8iDfA1y h1SfsYcGZfB40AUeRAOL/NTrAt/3Hi7FZf55mZuysC5Xy+GnKpR9PkdaJkOakwLJGVoJ63 CRhwExgC6FuKJmVgkc/uCg+82YZW5AaIRwVlQ9SwuhvwlYBaSdxxL1tNLWMmWIWkJ3kQuh 5SagRNpi4qL9yDZztvPb3rNdLVluZRYntH0Tgv8gFVy95DQ79xZMJJ0GLAwnH+HnmTQLDp xIu2g8HfmMTc6aj6+CRwbPnGTQcMEwy/gySCCRDOr+juC2ZMyp8Ufm9EJAHUMQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1622317878; a=rsa-sha256; cv=none; b=tTTdwAu2sICVO8zBCLYO1vJ+ESwLAnNut7TLn1UF3Sj34rGe0lIbtMk1MQIVWPkGL62EXv gymBugrwjB+Ztx4ahHUcTv1D5+pswRVCQdkTtOlZzd9+3urIsmHFF0PIxnTQ0eKdOdlngH xISON3p2Ju/aBXp/WNwSFYW1tRiVMES3q/BYTdASIAXItIzdoxc/AeQELwaDaaf6Mvh0AW BisUNLW+hVHgVQKtSHSCC6FRkz83tzXRNfM/cwHvffxaa1oKoJYA36BqzHTasJr2eHwQ32 wacIpDly1AwkZRocf2YEBJRp2TPz70RKY45m0M7nzDlBs0Z8cGlAS1QS4QClDw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -2.43 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: 8F43F1EB9A X-Spam-Score: -2.43 X-Migadu-Scanner: scn1.migadu.com X-TUID: bLm3OVsPkA6a Hello, sbaugh@catern.com writes: > HTML export wraps headlines in anchor tags with IDs, so that they can be > linked by suffixing #[anchor-tag-ID] to the URL. > > HTML export used to use anchor IDs like "sec-2" for the second headline, > but at some point it switched to generated IDs like "org7ffb324", which > change on every re-export. > > This means anchor-links on external sites (that is, links which link to > a specific section of an org file) break every time an org file is > re-exported to HTML. The old style of anchor IDs would break URLs when > sections moved around, but at least it wouldn't break on every > re-export! > > This makes org much less useful for typical web publishing use cases. > > This can be worked around by setting CUSTOM_ID for every headline, which > will override the anchor id used, but I think it was much better when it > just worked by default... > > It looks like this was changed in commit > 459033265295723cbfb0fccb3577acbfdc9d0285 > "Export back-ends: Use `org-export-get-reference'" > > Perhaps this functionality (of generating anchor IDs based on the > section number) could be added back in? No, for public links, CUSTOM_ID is the only sane way to handle this. Even "sec-2" could betray you if you slightly modify the document. Regards, -- Nicolas Goaziou