Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ruby markdown parser with WikiWord support?

I am using git-wiki for my personal note storage. It works very well, except that WikiWords are converted to links before the markdown parsing stage, using a regular expression. This messes up scores of things, for instance links that point to outside wiki pages, or block quotes (if I am quoting something, I do not want a WikiWord to be changed into a link).

Are there ruby-based Markdown parsers that understand WikiLinks?

like image 755
Rom1 Avatar asked Jul 25 '11 08:07

Rom1


1 Answers

The best parser around is the C-based one (upskirt/sundown), whose ruby iteration is red carpet:

https://github.com/tanoku/redcarpet

It is better for performance and security reasons.

For the wiki links, pre-process them before sending your text to the markdown parser.

like image 82
Denis de Bernardy Avatar answered Sep 25 '22 08:09

Denis de Bernardy