Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change footnote order #32

Merged
merged 4 commits into from
May 14, 2019
Merged

Change footnote order #32

merged 4 commits into from
May 14, 2019

Conversation

wooorm
Copy link
Member

@wooorm wooorm commented May 13, 2019

Previously, the footer (if footnote definitions were found) showed all footnote definitions, in definition order. Even footnote definitions with the same identifier were transformed to multiple definitions.

remarkjs/remark-rehype#11 shows that definition order does not make sense if inline footnotes ([^Some text]) are used in combination with footnote references ([^id]) and footnote definitions ([^id]: Some text).

Investigating this, I came to the conclusion that it also does not make sense to output all definitions, whether they are used (or even duplicate) or not.

Instead, it makes sense to track the order in which footnotes are used (first), and only output a definition for the used inline footnotes / footnote references, in the order they were used. This is in line with how link definitions are used as well.

/cc @CxRes

Closes remarkjs/remark-rehype#11.

@wooorm wooorm merged commit fd38c45 into master May 14, 2019
@wooorm wooorm deleted the change-footnote-order branch May 14, 2019 16:45
arobase-che added a commit to arobase-che/zmarkdown that referenced this pull request Jul 24, 2019
**This commit only convert new identifiers to string.**
Identifiers used to be strings but in the previous version of this plugin,
identifiers were converted to numbers.

Now the type is preserved.

Adapt the plugin to the commit of mdast-util-to-hast#fd38c454
See the issue: syntax-tree/mdast-util-to-hast#32

It updates the order of footnotes to a more coherent one.
But identifiers no longer allowed to be number.
arobase-che added a commit to arobase-che/zmarkdown that referenced this pull request Jul 24, 2019
arobase-che added a commit to arobase-che/zmarkdown that referenced this pull request Jul 24, 2019
@wooorm wooorm added ⛵️ status/released 🗄 area/interface This affects the public interface 🦋 type/enhancement This is great to have 🧑 semver/major This is a change labels Aug 11, 2019
@wooorm wooorm added the 💪 phase/solved Post is done label Apr 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🗄 area/interface This affects the public interface 💪 phase/solved Post is done 🧑 semver/major This is a change 🦋 type/enhancement This is great to have
Development

Successfully merging this pull request may close these issues.

Incorrect Footnote Order
1 participant