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

Feature footnotes #351

Closed
wants to merge 4 commits into from
Closed

Conversation

lepture
Copy link
Contributor

@lepture lepture commented Feb 17, 2014

Footnotes feature. It looks like MultiMarkdown Footnotes Syntax:

Here is some text containing a footnote.[^somesamplefootnote]

[^somesamplefootnote]: Here is the text of the footnote itself.

Related Issue: #27

@chjj Have a review of this patch. I will add test cases soon.

@lepture
Copy link
Contributor Author

lepture commented Feb 17, 2014

NOTE: this feature is not fully implemented. There are still works to be done.

Here is some text containing a footnote.[^somesamplefootnote]

[^somesamplefootnote]: Here is the text of the footnote itself.
  multi paragraph

  * and even **markdown** markup in a footnote

We need to hack the text value of footnote, just like a list item.

@prashaantt
Copy link

Awesome @lepture, I would love this to be finished and pulled in. I began writing this myself a couple of days ago (see also #27 (comment)) but couldn't wrap my head around some of the stuff and gave up the first attempt (JS noob here).

@lepture
Copy link
Contributor Author

lepture commented Feb 18, 2014

@prashaantt I am not sure that @chjj would agree with this feature. I'd like to implement the unfinished part when @chjj says yes.

@limjiayi
Copy link

This would be amazing @lepture and @chjj, I would love for this feature to be added as well.

@lepture
Copy link
Contributor Author

lepture commented Feb 20, 2014

@prashaantt @contactjiayi I've just created a python fork of markdown. And I am working on footnotes feature in this repo: https://github.com/lepture/mistune

chjj added a commit that referenced this pull request Feb 23, 2014
@chjj
Copy link
Member

chjj commented Feb 23, 2014

Put up a branch and added a few fixes (footnotes weren't working for two different reasons). I still want to play around with it a bit more.

cc @lepture

@lepture
Copy link
Contributor Author

lepture commented Feb 24, 2014

@chjj There is still work to do with the footnotes rendering. For example, multiple lines of one footnote. We should unindent each line, and parse the footnote again.

Here is what I did in the Python fork https://github.com/lepture/mistune/blob/master/mistune.py#L691

@chjj
Copy link
Member

chjj commented Feb 24, 2014

@lepture, oh, this doesn't handle (unindented) multiparagraph footnotes? I had my own branch written that accomplished this in a really sloppy way, but when I saw your code I assumed you did it a little bit better. I'll push my other branch now.

chjj added a commit that referenced this pull request Feb 24, 2014
@lepture
Copy link
Contributor Author

lepture commented Feb 24, 2014

@chjj I did it in my Python fork. Seems your solution is better, I'll merge it into mine.

@lepture
Copy link
Contributor Author

lepture commented Feb 24, 2014

@chjj Use footnote_start and footnote_end is a good idea. But I think my way is more elegant now. It looks like parsing list item.

lepture/mistune@a1f925e

@chjj
Copy link
Member

chjj commented Feb 24, 2014

I'm totally open to different methods. Like I said, I find my way sloppy. I'll take a look at this in a bit.

@mattly
Copy link

mattly commented Feb 24, 2014

Here's the showdown implementation of footnotes if that helps. Quibbles about footnote class and a[rel="footnote"] vs. a.footnoteRef aside, it's almost identical to discount's implementation.

I would love to see this feature in Marked because I want access to the parse tree for other reasons.

@lepture
Copy link
Contributor Author

lepture commented Feb 26, 2014

@chjj I'll sort out it soon, and send you my patch. I've finished the Python fork, and it works well.

@jonschlinkert
Copy link

👍

@hugovincent
Copy link

Is this still being worked on or has it been rejected? I'd love to see this feature supported.

@jesselawson
Copy link

I'm relying on marked pretty heavily for some web apps in development so this will be something I will be actively creating in the next 24 hours. Stay tuned!

@nournia
Copy link

nournia commented Apr 2, 2014

I've used marked.js of this PR as parser of EpicEditor. This results Invalid regular expression error. Is it something wrong with that editor?

@prashaantt
Copy link

Hello @chjj, @lepture, do you guys have any update on this?

@hugovincent
Copy link

Hi @chjj, @lepture, any plans to merge this into master? I'm using the feature-footnotes branch successfully.

@prashaantt
Copy link

@hugovincent I agree it works in the basic scenario, but not when the footnote text is itself written in Markdown — i.e. MD-formatted links and formatting in the footnote definition don't get parsed into HTML.

@prashaantt
Copy link

In case anybody's interested, I just pushed an update to my clone of the feature-footnotes branch that sacrifices performance and breaks marked's linearity but does get indented multi-para footnotes working correctly with inline Markdown parsing. It basically works, but is still nowhere near the full functionality as given here.

I tried @chjj's footnotes branch that attempts to do this better, but ran into rendering issues. I would be delighted if it could be finished officially once @chjj can spare some time.

@jeffmcneill
Copy link

Not sure if this will help, but here are several implementations:

Support footnotes as implemented in Multimarkdown, Marked2, PHP Markdown Extra, and/or Pandoc.

@afischer
Copy link

Does it look like this will be implemented?

@marr
Copy link

marr commented Nov 16, 2015

Needs rebase. Fwiw, I'd consider multimarkdown(mmd) for their footnote support, but their node package isn't compiling for me. mnichols/node-mmd#4

Hope to see footnotes added to marked soon!

@joshbruce
Copy link
Member

Closing as stale, missing tests, and merge conflicts.

@joshbruce joshbruce closed this Dec 26, 2017
@lepture lepture deleted the feature-footnotes branch December 27, 2017 00:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.