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

footnotes stop working, when using glossarify #38

Closed
MrGung opened this issue Oct 4, 2019 · 4 comments · Fixed by #40
Closed

footnotes stop working, when using glossarify #38

MrGung opened this issue Oct 4, 2019 · 4 comments · Fixed by #40
Labels
enhancement New feature or request vuepress vuepress integration issues

Comments

@MrGung
Copy link

MrGung commented Oct 4, 2019

Hi,

I am using vuepress 1.1.0 with markdown-it-footnote 3.0.2.

When activating glossarify (2.0.0) - footnotes stop working, i.e. [^footnote1] is displayed verbatim instead of being a link.

@about-code
Copy link
Owner

I suspect what causes the references to be displayed verbatim is the fact that the markdown AST stringifier remark-stringify used internally translates the colon of the footnote into an HTML entity sequence, so instead of

This is a text with a footnote [^footnote].

[^footnote]: This is correct

it renders

This is a text with a footnote [^footnote].

[^footnote]: This is wrong

I played around with the respective remark-stringify options options.gfm and options.entities with no success so far. Part of the problem could be that there is no distinct representation of footnotes in the AST produced by remark-parse which adheres to the CommonMark Specfication. This spec, which is currently at v0.29, doesn't specify footnotes, so they must be considered custom markdown extensions of the markdown-it toolsuite used with vuepress.

This is not to say it's impossible to solve but just to provide a bit more context to the issue and why footnotes do not work out of the box at the moment.

@about-code about-code added the vuepress vuepress integration issues label Oct 4, 2019
about-code added a commit that referenced this issue Oct 4, 2019
…. Support for Pandoc footnote syntax will be considered *experimental* until it becomes part of the official CommonMark Specification at https://spec.commonmark.org. See also https://pandoc.org/MANUAL.html#footnotes.
@about-code
Copy link
Owner

Okay turned out to be easier than expected. After a look at the source files I found that remark-parse and remark-stringify both already implement support for footnotes but the feature must be enabled explicitely with the parser and options.footnotes (instead of the stringifier where I looked first).

Since they are not yet officially part of the CommonMark Spec glossarify-md v2.1.0 will also require explicit feature toggling by a separate boolean config option experimentalFootnotes. When set to true footnotes will be rendered according to Pandoc syntax as expected by markdown-it-footnote.

@about-code about-code reopened this Oct 4, 2019
about-code added a commit that referenced this issue Oct 4, 2019
* feat: New option `--experimentalFootnotes` for Markdown footnotes (#38). Support for Pandoc footnote syntax  will be considered *experimental* until it becomes part of the official CommonMark Specification at https://spec.commonmark.org. See also https://pandoc.org/MANUAL.html#footnotes.
@about-code about-code added the enhancement New feature or request label Oct 4, 2019
@MrGung
Copy link
Author

MrGung commented Oct 4, 2019

Thanks for the ultra fast fix. I'll bump up the Version on monday.

@MrGung
Copy link
Author

MrGung commented Oct 7, 2019

Works! Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request vuepress vuepress integration issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants