jackfletch / remark-numbered-footnote-labels

remark plugin to label footnotes with numbers
MIT License
8 stars 0 forks source link

remark@next (13) #4

Open wooorm opened 4 years ago

wooorm commented 4 years ago

Hi!

remark is switching to a new parser internally (micromark, see remarkjs/remark#536 for more info). From a quick glance at the code, it seems this plugin should be fine (although footnotes are in remark-footnotes). However, it would be good to check that in the future (there is 13.0.0-alpha.0 published now, and one or two more will come before the release)

jhull commented 4 years ago

Having an issue as of late ...

please upgrade to remark 13 to use this plugin

Any idea how to easily fix this?

jackfletch commented 4 years ago

Apologies, been busy with work as of late. At first glance, this update will require a rewrite; I'll take a crack at it this weekend.

Some context: This plugin essentially modifies remark-footnotes's logic to write an index as the footnote node's label instead of using the identifier (the string identifying the footnote, [^example-footnote-identifier]. I took a quick look at the new parser micromark and remark-footnotes's change for this update (remarkjs/remark-footnotes@0cfeae1dcd0d0bef743e64805df2fe741d00bb08). It seems all the footnote logic has moved to mdast-util-footnote. Copying the from-markdown.js and to-markdown.js files there and changing the footnote label logic is essentially what I'll be "fixing."

If the new logic allows, this could even be upstreamed as an option for remark-footnotes.

wooorm commented 4 years ago

@jhull I think that message is emitted by remark-footnotes, not this plugin. If it is emitted, it means you are using a newer remark-footnotes, with an older remark.

@jackfletch I don’t think you need to worry about that. This plugin does not integrate with the parser. remark-numbered-footnote-labels runs after remark-footnotes on the syntax tree to change the identifiers.

jhull commented 4 years ago

Thanks @wooorm, though I've read your comment a couple times and still can't figure out the next step - if this is the only plugin I found that actually created proper footnotes, I should...?

This is what I have for remark now:

    "remark-container": "^0.1.2",
    "remark-numbered-footnote-labels": "^1.1.0",
    "@silvenon/remark-smartypants": "^1.0.0",
wooorm commented 4 years ago

You need remark-footnotes in there somewhere.

This plugin needs remark-footnotes to be used beforw it. It doesn't create footnotes, it changes their labels

wooorm commented 4 years ago

Also see the open issues of the other plugins. They might need internals to change

jhull commented 3 years ago

This was actually an issue with another plugin, NuxtJS's Content module. They haven't updated remark-parse to the latest.

Downgrading to remark-footnotes 2.0 solved this temporarily for me.