-
-
Notifications
You must be signed in to change notification settings - Fork 32
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
Footnote in AST lacks index information #43
Comments
I'm not sure where we'd store them. |
Can we add an extra field to the -- | Note <footnoterefname> <footnote>
Note Text [Block] Just to provide some context: since I need to render in GHCJS, I'm rendering the footnotes by traversing the AST. https://github.com/srid/reflex-dom-pandoc/blob/master/src/Reflex/Dom/Pandoc/Footnotes.hs You can see how it renders at https://www.srid.ca/1948201.html In this example, there are four footnotes named 1, 2, 3 and 4. However if you actually look at the source markdown, the footnotes don't use numbers but custom text. I thought it would be nice re-use the same footnote ref as the user provided; but this information is not passed to the Pandoc AST. Adding a field to the |
Some relevant discussion here: But I generally like to avoid changes to pandoc-types, which are painful for the whole ecosystem (everything has to be changed). For your purposes, you could create a special instance of IsInline and IsBlock for pandoc, instead of using the one provided in commonmark-pandoc. You could put the contents of each note in a Div and put the label in an attribute of the Div. That would allow you to get it back out again. |
That said, it could be worth putting an issue on pandoc-types suggesting this. |
I suppose the most obvious useful change would be to add an Attr field to the Note constructor. |
The
HasFootnote
instance for Pandoc AST ignores the footnote identifiers, and labels:commonmark-hs/commonmark-pandoc/src/Commonmark/Pandoc.hs
Lines 215 to 219 in c9afe7c
And it looks like Pandoc is doing its own state management to compute the identifier, and render the references accordingly. Is storing these footnote identifiers/labels in the Pandoc AST explicitly out of scope?
The text was updated successfully, but these errors were encountered: