From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms1.migadu.com with LMTPS id MB8ZGqY9FmbREgAAqHPOHw:P1 (envelope-from ) for ; Wed, 10 Apr 2024 09:20:06 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id MB8ZGqY9FmbREgAAqHPOHw (envelope-from ) for ; Wed, 10 Apr 2024 09:20:06 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=protesilaos.com header.s=gm1 header.b=bR2xPbzI; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1712733606; a=rsa-sha256; cv=none; b=tJ4uNZLHiDyFHTG4CbMNBW5zOzo8oAe8K2kgf9/ki5+3FkSc4Gd8F3svd7WZXU0FBqFsKr cA8caNlC4K1d34gpX4DgT4zGM4aO8HQk1cWh4xRhvdiPEiIt1oD7teu9RBLpMIW8IKwFt6 HqTrh/F1ICSSnYJ+RJAjxMesr/glo6Br2Gcq328s3VCfGW59D7UOR2AEBGvcYW58YIUrOs h+Hwa+ucH4uP4PyA5F0rNWEHp+wB+5vZy53K/PQQy6BJicI6T+bcvnI3RgpVNeEcqYMK9o v3csoqBAYhQsqpTHXIEKEfnTNHUqVsv79UELqIY6Q+ghHbcqLFo1Uh2tvTZaCw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=protesilaos.com header.s=gm1 header.b=bR2xPbzI; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1712733606; 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:dkim-signature; bh=j/jrqOnRolrHU/WBcOiqEXOZcgL4tYaUwhV3N4XPZIM=; b=ZRRL+YHGuH7fRONXR/fhe8YIKnzZK9/lzdG3Sx7yCjFarxbYvKodNH4lLp4eosYemZrO0Q Pn2YruZy4tzHfDfA4k8YYouELymok+TxSkGlWRQtChZ4ps1Spm4tuVQEChaaLSJ4m4F03X BjC//yPS3JRRurn21jX72roWHB5+XYVHZBCUMN3KTT0ZCvCU2ghUgkaoOOEvjQK1ojlwmV kK77dI0XDG7aXQuwXnpJRuKAkcyog6mcGiJLPIk6ezJ3c1GbsOtNPV2JGHBkP9HS4kMlOu CIY7CtXgoeK9godcZ9kt2nEdmxuKG02NXHbpHmEWRwfA9SgKvp+A5a0yeFtRtw== 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 D4C116E21C for ; Wed, 10 Apr 2024 09:20:05 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ruSEt-0006Ai-Cv; Wed, 10 Apr 2024 03:19:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ruSEr-0006AU-4b for emacs-orgmode@gnu.org; Wed, 10 Apr 2024 03:19:21 -0400 Received: from relay2-d.mail.gandi.net ([2001:4b98:dc4:8::222]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ruSEp-0002sC-Cj for emacs-orgmode@gnu.org; Wed, 10 Apr 2024 03:19:20 -0400 Received: by mail.gandi.net (Postfix) with ESMTPSA id A9F6840004; Wed, 10 Apr 2024 07:19:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protesilaos.com; s=gm1; t=1712733554; h=from:from: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; bh=j/jrqOnRolrHU/WBcOiqEXOZcgL4tYaUwhV3N4XPZIM=; b=bR2xPbzIixkrMkSrduFdpxANk9FqW2UrJoSEekauxkTk1Ol7FFAdYHgB5Npk6sVh6XF7ss kCDaESC8PBGidaoPmU1i9sr0eCLQQg9LpweiiFdY5r1jMhGXTz1xx8BSp8GvDJRrX+UVKK rcD4eHwYA/fZ17zhiFSwkOLih4yrk3z2+OZFMQqAeRttdBofTjjBAitgPY3eTphBE3FVzD Ew58Kd+afCTP4YglucdACSKoZ3Vl18iGOZZbn/SLpvtS1zvMqV9TFMrP+LSdfXpCcMHgBI XeInd5tniTiRhHca25SzdK65tdTtx4lqajh86BlE1yJ22QREa+ddIhkfBMCKrQ== From: Protesilaos Stavrou To: Ihor Radchenko Cc: emacs-orgmode@gnu.org Subject: Re: [BUG] HTML export does not preserve footnote label [9.6.15 (release_9.6.15 @ /usr/local/share/emacs/30.0.50/lisp/org/)] In-Reply-To: <87o7anop4i.fsf@localhost> References: <877chcyz36.fsf@protesilaos.com> <87o7anop4i.fsf@localhost> Date: Wed, 10 Apr 2024 10:19:12 +0300 Message-ID: <87y19lfzwv.fsf@protesilaos.com> MIME-Version: 1.0 Content-Type: text/plain X-GND-Sasl: info@protesilaos.com Received-SPF: none client-ip=2001:4b98:dc4:8::222; envelope-from=info@protesilaos.com; helo=relay2-d.mail.gandi.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Spam-Score: -6.47 X-Migadu-Queue-Id: D4C116E21C X-Migadu-Spam-Score: -6.47 X-Migadu-Scanner: mx10.migadu.com X-TUID: DMpAEi1o69hX Thank you Ihor for looking into this! > From: Ihor Radchenko > Date: Fri, 5 Apr 2024 14:33:49 +0000 > [... 13 lines elided] >> I looked into the ox.el and noticed that the export data does include >> the labels. But 'org-html-footnote-reference' does not have a call to >> get the label: it assigns a number outright. To experiment with >> retrieving the data, I tried this: >> ... >> (let* ((n (or >> (org-export-get-footnote-label footnote-reference) >> (org-export-get-footnote-number footnote-reference info))) >> ... >> Can we have footnotes with their label preserved? Or maybe is this going >> to break a lot of functionality? I am aware the above not work for >> footnote definitions, as those also get the number. > > The problem arises when only some footnotes have a label: > > This is a test 1 [fn:n24aa:These are the contents] and here is more[fn::another one]. > > What to do with the unlabelled ones? Assign a number? If yes, what kind > of number? `org-export-get-footnote-number' counts all the footnotes, > including labelled ones; so that returned number will be 2 in the above > example, leading to awkward ^n24aa followed by ^2 footnote. > But even without `org-export-get-footnote-number', ^n24aa ^1 mixture > might be awkward. > > One way could be only using footnote labels when _all_ the footnotes > are labelled. I think it is fine to have an all or nothing approach, if this is easier to do. Though I should have clarified my intent earlier: the idea is to use the label as a fixed reference to the footnote, so that the link does not change between exports. This is the same principle as what we do with links to headings that have a CUSTOM_ID. As such, the anchor text can still be the way it is now as an automatically generated number sequence (^1, ^2, etc.), but the HTML "id" and "href" values will be constructed based on the label of the footnote, NOT its number in the sequence. What do you think? Thank you again for your time and efforts! -- Protesilaos Stavrou https://protesilaos.com