xoofx / xoofx/markdig

Using `Label` instead of `Order` in a `Footnote`

Open
#684 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

question
Dominant language
C#
Stars
5.3k
Forks
510
Avg merge
8d 5h
Merged PRs (30d)
5

Description

I am working with documents and Islamic commentaries. My goal is to preserve the original footnote numbers or labels so they can be searched and found by the users and so users can also cite the original footnote when needed. So I need to preserve the original footnote.

There are two issues:

  1. For larger works, like books and commentaries, the original text is broken into multiple sections (which can be hundreds or even thousands for multi-volume works) and each section will be stored in its own markdown.
  2. Some works have footnotes that use non-numeric labels. For example, this Quran commentary book (e.g. page 112) uses letters a, b etc. for footnotes.

Based on that, it looks like footnotes need a feature where Footnote.Label can be used in the markup instead of the Footnote.Order property.

Then, based on an option provided, HtmlFootnoteGroupRenderer will either use Order or Label (without the ^ prefix).

If this proposal seems acceptable, I can try to make a pull request (not sure though what the time frame might look like).

Comments/suggestions/feedback welcome.

I looked at this list of issues and didn't find a similar issue.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading src/Markdig/Extensions/Footnotes/Footnote.cs, especially Label and Order, then inspect HtmlFootnoteGroupRenderer.cs to understand the current output path. Define the option and behavior for choosing Order or Label, and verify that numeric and letter-based footnotes render with the selected value without the ^ prefix.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.