Sha256: b5461361c84fb6b9f52c43e1379528c36c3572f5d75444d15fc49c1a7142d378

Contents?: true

Size: 1.4 KB

Versions: 13

Compression:

Stored size: 1.4 KB

Contents

Title: Use Redcarpet as a Markdown Filter for Haml in Rails

Description: Haml by default does not use Redcarpet Ruby Gem if available as the dependecy to parse Markdown text format. But it’s easy to overwrite the Haml internal to use Redcarpet.

Publish Time: 2011-07-16 19:00:00 +0800

-----

Haml makes it very easy to include text in various formats such as CSS, JavaScript, Markdown or Textile. Specifically for Markdown, Haml depends on additional Ruby Gem such as RDiscount, peg-markdown, or Maruku. Recently, there is a new Ruby Gem for Markdown parser called [Redcarpet](https://github.com/tanoku/redcarpet), created by [Vicent Martí](https://github.com/tanoku).

Redcarpet is basically a Ruby wrapper of [Upskirt](https://github.com/tanoku/redcarpet), which originally created by Natacha Porté. Upskirt is a standard compliant Markdown parser and it supports many extensions such as non-strict emphasis, fenced code blocks, tables, and autolinks. One of the best features of Upskirt is that it handles arbitrary and malicious input text very well.

> Upskirt has been extensively security audited, and includes protection against all possible DOS attacks (stack overflows, out of memory situations, malformed Markdown syntax...) and against client attacks through malicious embedded HTML.

To integrate Rercarpet and Haml in your Rails app, first add the Redcarpet gem in the `Gemfile`.

    gem "redcarpet", "~> 1.17.2"

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
concen-0.2.9 test/support/raw_text/code_blocks.txt
concen-0.2.8 test/support/raw_text/code_blocks.txt
concen-0.2.7 test/support/raw_text/code_blocks.txt
concen-0.2.6 test/support/raw_text/code_blocks.txt
concen-0.2.5 test/support/raw_text/code_blocks.txt
concen-0.2.4 test/support/raw_text/code_blocks.txt
concen-0.2.3 test/support/raw_text/code_blocks.txt
concen-0.2.2 test/support/raw_text/code_blocks.txt
concen-0.2.1 test/support/raw_text/code_blocks.txt
concen-0.2.0 test/support/raw_text/code_blocks.txt
concen-0.1.7 test/support/raw_text/code_blocks.txt
concen-0.1.6 test/support/raw_text/code_blocks.txt
concen-0.1.5 test/support/raw_text/code_blocks.txt