all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Protesilaos Stavrou <info@protesilaos.com>
To: Ihor Radchenko <yantar92@posteo.net>
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/)]
Date: Wed, 10 Apr 2024 10:19:12 +0300	[thread overview]
Message-ID: <87y19lfzwv.fsf@protesilaos.com> (raw)
In-Reply-To: <87o7anop4i.fsf@localhost>

Thank you Ihor for looking into this!

> From: Ihor Radchenko <yantar92@posteo.net>
> 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


  reply	other threads:[~2024-04-10  7:20 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-05  8:48 [BUG] HTML export does not preserve footnote label [9.6.15 (release_9.6.15 @ /usr/local/share/emacs/30.0.50/lisp/org/)] Protesilaos Stavrou
2024-04-05 14:33 ` Ihor Radchenko
2024-04-10  7:19   ` Protesilaos Stavrou [this message]
2024-04-10 14:31     ` Ihor Radchenko
2024-04-12  7:05       ` Protesilaos Stavrou
2024-04-13 14:00         ` Ihor Radchenko
2024-04-26  7:55           ` Protesilaos Stavrou
2024-04-26  8:17             ` Protesilaos Stavrou
2024-04-26  9:53               ` Max Nikulin
2024-05-03  6:59                 ` Protesilaos Stavrou
2024-05-03 10:53                   ` Max Nikulin
2024-05-03 11:14                     ` Ihor Radchenko
2024-05-03 17:29                       ` Max Nikulin
2024-04-28 10:37               ` Ihor Radchenko
2024-05-03  9:07                 ` Protesilaos Stavrou
2024-05-03 11:28                   ` Ihor Radchenko
2024-04-28 10:22             ` Ihor Radchenko
2024-05-03  7:00               ` Protesilaos Stavrou
2024-04-28 10:36           ` Ihor Radchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87y19lfzwv.fsf@protesilaos.com \
    --to=info@protesilaos.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=yantar92@posteo.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.