From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms1.migadu.com with LMTPS id WBmCGye7D2ZiPgAAe85BDQ:P1 (envelope-from ) for ; Fri, 05 Apr 2024 10:49:43 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id WBmCGye7D2ZiPgAAe85BDQ (envelope-from ) for ; Fri, 05 Apr 2024 10:49:43 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=protesilaos.com header.s=gm1 header.b="hM/zbL6F"; 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=1712306983; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=uVsWVolnJ33rumQ2CRc+0N9A4Bp3Bi6bEGestlacArs=; b=fDIJZGIzJNyV/Rq1EToAvh+JTw6YJc96v9ej37Psvn+FxzbQYtKSeHYUO+lNGtZxlvEvBp UOJUu+uiTtipYBNyc/FPU1cCcfJoH3Bqkdv3/vd6Jwq6qjU1sxF1+HHKZqACfriiGHZB5t RYMcgSdC+Y9Xwy5BXa+94qey7z+P93COVPdcexBxc3kRCvj2arW4hQ8iK/aDU5QQx9CdjT qA+M0bR1jVFjD0TATjNdZDblq2Q9uGh6vFI/ibrmDm0oQ+2ATEulmpRtUYLO6r8+Px7IMH nUOmDu/4OMdoq5xof54Cw+QJ/ZE8zJG1dqhY7hhMD6CBN3Z6BEXEw2jwccoHqw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=protesilaos.com header.s=gm1 header.b="hM/zbL6F"; 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=1712306983; a=rsa-sha256; cv=none; b=akOvX69e1j7Y2IdHyCTSZ5QsCG1nHw0pVpun65T7nfd9/xMqr/wWtrpogEvL2XJtmntgGU 6/Jts2AUSIk81L3s9qYwXno+sNzAhCQ+PPLweeilicQMULKIoIplvVnlSqKEv1mNj0RqSs 2pNAWIsZHnAIp9XoUukv9paDmGlXlDz2qvUueEZplHfv6CHv438sE874MahdGnjLROUdgh PTwkkt7gOz4+kX3kffkzG3AOpFnUSK1XmUx3cj6ITzFYSRZdlgm3cjGSPcT4dlmo3e3t5Z yejnvvRlIsuDrgbMCIzFw0wcxbMv+o1FsTE4zM5bRTwHoSrHDwzreE3HyRntqA== 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 2617F62116 for ; Fri, 05 Apr 2024 10:49:43 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rsfFX-0000sR-Iu; Fri, 05 Apr 2024 04:48:39 -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 1rsfFW-0000s8-FU for emacs-orgmode@gnu.org; Fri, 05 Apr 2024 04:48:38 -0400 Received: from relay6-d.mail.gandi.net ([2001:4b98:dc4:8::226]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rsfFU-0003wf-5M for emacs-orgmode@gnu.org; Fri, 05 Apr 2024 04:48:38 -0400 Received: by mail.gandi.net (Postfix) with ESMTPSA id 3514FC0008 for ; Fri, 5 Apr 2024 08:48:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protesilaos.com; s=gm1; t=1712306911; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=uVsWVolnJ33rumQ2CRc+0N9A4Bp3Bi6bEGestlacArs=; b=hM/zbL6FLEOpWGVe/clghBKM/N9xfDXNTwf5JFxmm4W+tu1A9X9bM0jgpsqSYdzppOq8Zc xTlQvyxA89/InZAaVk0RBwDUy6pY2GnYgBM9Ex8zJ/hPj+cKfH0Rvvj7Ny18Jh7mSYIKT1 marXCVp6Ru/ZoB5KIOY+B1EyHOD8gLpspaL4N8gpmbfAmnS1cwjqn/2QQK0EiH993gM+4h xB/iQzFdyh5wUHJSBhNkbZWORADMI2mhPohp6QP+2YBgJAjXof+mhvjrFhWTwqFYx8IwFU hXLuHvg0gs96Ta+wSnuxE8BgrksN/+kvK1K+sudMx1cUTmgkj02+NUNZPKjtvg== From: Protesilaos Stavrou To: emacs-orgmode@gnu.org Subject: [BUG] HTML export does not preserve footnote label [9.6.15 (release_9.6.15 @ /usr/local/share/emacs/30.0.50/lisp/org/)] Date: Fri, 05 Apr 2024 11:48:29 +0300 Message-ID: <877chcyz36.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::226; envelope-from=info@protesilaos.com; helo=relay6-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-Migadu-Spam-Score: -7.75 X-Migadu-Scanner: mx11.migadu.com X-Spam-Score: -7.75 X-Migadu-Queue-Id: 2617F62116 X-TUID: 4G0ipqrPyNKM Dear maintainer, I have an Org file with contents like the following: This is a test 1 [fn:n24aa:These are the contents] and here is more. When I do an HTML export, the footnote's label (n24aa) is not preserved in the exported HTML. Is this intended behaviour? I was expecting it to keep the label as a user-defined unique identifier. 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: ;; PROOF-OF-CONCEPT that works for footnote references but not ;; footnote definitions (defun org-export-get-footnote-label (footnote) (org-element-property :label footnote)) (defun org-html-footnote-reference (footnote-reference _contents info) "Transcode a FOOTNOTE-REFERENCE element from Org to HTML. CONTENTS is nil. INFO is a plist holding contextual information." (concat ;; Insert separator between two footnotes in a row. (let ((prev (org-export-get-previous-element footnote-reference info))) (when (eq (org-element-type prev) 'footnote-reference) (plist-get info :html-footnote-separator))) (let* ((n (or (org-export-get-footnote-label footnote-reference) (org-export-get-footnote-number footnote-reference info))) (id (format "fnr.%s%s" n (if (org-export-footnote-first-reference-p footnote-reference info) "" ".100")))) (format (plist-get info :html-footnote-format) (org-html--anchor id n (format " class=\"footref\" href=\"#fn.%s\" role=\"doc-backlink\"" n) 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. I am happy to keep studying the export infrastructure if you give me some pointers. Thank you for your time and for maintaining this wonderful project! All the best, Protesilaos (or simply "Prot") * * * Emacs : GNU Emacs 30.0.50 (build 3, x86_64-pc-linux-gnu, GTK+ Version 3.24.38, cairo version 1.16.0) of 2024-04-03 Package: Org mode version 9.6.15 (release_9.6.15 @ /usr/local/share/emacs/30.0.50/lisp/org/) -- Protesilaos Stavrou https://protesilaos.com