:footnotes extension won't work in Redcarpet Ruby gem

こ雲淡風輕ζ 提交于 2019-12-08 02:26:31

问题


I must be missing something very obvious -- I can't get footnotes to work with redcarpet. I have version 3.0.0:

> gem list redcarpet
*** LOCAL GEMS ***

redcarpet (3.0.0)

I am trying code from the test code on the Github repo that has footnotes and it won't convert the Markdown to HTML that contains the footnote. I reduced the code down to just the footnotes function and put it on Gist.

The output is simply as follows:

<p>This is a footnote.[^1]</p>
<p>[^1]: It provides additional information.</p>

What am I missing here?


回答1:


I have had this problem as well. It looks like the Rubygem needs to be updated past version 3.0.0 in order for footnotes to work. There are changes in the master branch which aren't available on Rubygems.

To fix your issue for the time being, source the gem from the Redcarpet Github repo:

gem 'redcarpet', github: 'vmg/redcarpet', branch: 'master'

Then run bundle install. Footnotes should now work.

I've opened an issue on the Redcarpet repo to try to get someone to update the Rubygem with the latest changes. I'll post back here if/when that's done.




回答2:


Actually, the :footnotes extension is only on master ; we haven't yet released a version which ships with this feature. This will be in 3.1.0 (since we are using semantic versioning) that we are about to release (we have still some adjustments to do). You can safely depend on the master branch of the repository ; we are always ensuring that our test suite is green on Travis!

Thank you, have a nice day!



来源:https://stackoverflow.com/questions/18863152/footnotes-extension-wont-work-in-redcarpet-ruby-gem

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!