Skip to content

Releases: vmg/redcarpet

Redcarpet 3.2.0

18 Oct 09:01
Compare
Choose a tag to compare

Redcarpet v3.2.0

New features

Updates to the StripDown render

The StripDown render object will now handle images and correctly display links' URL. For instance:

Here's a ![squirrel](shipit.png) !

And an external [link](https://github.com).

Will now render to:

Here's a squirrel shipit.png !

And an external link (https://github.com) !

Introducing the Safe render

In order to safely deal with users' input for instance, Redcarpet now ships with a Redcarpet::Render::Safe object.

The :safe_links_only and :escape_html options are turned on by default. It also has a custom block_code callback since by default the specified language will be set as the class of the rendered code block.

Redcarpet::Markdown.new(Redcarpet::Render::Safe)

HTML5 block-level elements recognition

HTML5 blocks-level elements are now recognized so that they will not be included under a paragraph.

Deprecation

The Redcarpet's compatibility layer for the old RedCloth API has been deprecated. If you are still relying on it, please do update your code to rely on the new API.

This layer will be removed any time Redcarpet reaches 4.0.

Bug fixes

Some bug fixes have also been applied:

  • In-page links (with anchors) are now parsed when the :safe_links_only option is enabled (#372)
  • Trailing single quotes are now correctly converted to curly quotes using Smarty Pants (#340)
  • The equal sign (=) can now be escaped (e.g. when using the :highlight option) (#369)

Check out the CHANGELOG for further information.

Redcarpet 3.1.2

10 May 09:08
Compare
Choose a tag to compare

Redcarpet v3.1.2

This release remove the yielding of the anchor parameter when overriding the header callback. This change has been introduced in 3.1.0 but this was a breaking change for people upgrading from 3.0.0. We are sorry for the inconvenience !

Redcarpet 3.1.1

18 Feb 05:14
Compare
Choose a tag to compare

Redcarpet v3.1.1

This release of Redcarpet is meant to address a serious bug when rendering text that contains headings and contains all the prior enhancements of Redcarpet 3.1.0. For more information about Redcarpet 3.1.0, please see the release notes

Bug fixes

Fix a crash when rendering text that contained an anchor.

Redcarpet 3.1.0

14 Feb 17:47
Compare
Choose a tag to compare

Redcarpet version 3.1.0

It's been a long time since since we've released any version of Redcarpet but we are happy to announce the release of the version 3.1.0. Over 100 commits have been added since 3.0.0 with some new exciting features.

New features

Footnotes

This has been requested for a while but this is finally here. Redcarpet now ships with a :footnotes option for the Markdown object to allow you to use PHP-Markdown footnotes:

Markdown[^1] rocks!

[^1] : http://daringfireball.net/projects/markdown/

You can override the output through the #footnote_def, #footnote_ref and #footnotes callbacks. Thanks to the contributors of this feature!

GitHub style anchors

Previously, passing the :with_toc_data option to a render object would generate ids according to the order of apparition of the headers (e.g. toc_0). The anchors are now humanized to improve the output so your table of contents are cleaner and more "SEO-friendly".

Also, by default, any markup is stripped out from the id:

# This is really **cool**

will generate:

<h1 id="this-is-really-cool">This is really <strong>cool</strong></h1>

The :quote option

A :quote option has been added for the Markdown object and allows you to render quotation marks to <q> tags. You can override this output through the #quote callback.

Bug fixes

Apart from the new features, a few bugs have been fixed:

  • Fix code blocks' classes when using Google code prettify #314
  • Follow the standard to detect when new paragraph is outside last item #111
  • Make ordered lists preceded by paragraph parsed with :lax_spacing #311
  • Allow using tabs between a reference's colon and its link #337

Please see the changelog for further information.

Redcarpet 3.0.0

09 Jul 00:31
Compare
Choose a tag to compare

Robin, Vicent ,and I are happy to announce the release of Redcarpet 3.0.0! We've got the usual line up of goodies to talk about, so let's get to the good stuff.

Backwards Compatibility

We've removed support for Ruby 1.8.x in this release. If you still need Ruby 1.8.x support, then you'll need to stick with Redcarpet 2.3.0.

We've also removed the sundown submodule that was included in the Redcarpet codebase. Sundown has been deprecated for some time and all the code has been included in the redcarpet repository for awhile as well. So long Sundown and thanks for all the fish.

New features

Highlight support

We've got a new option you can pass to the Redcarpet::Markdown object: :highlight. This feature will let you use wrap a bit of text in a pair of equals signs and Redcarpet will generate markup that will cause it to be highlighted. If you want to use this option, you can use the following Ruby code:

markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML, :highlight => true)

to render the following markdown

This is ==highlighted== text, yo.

as

This is <mark>highlighted</mark> text, yo.

Thanks to Sam Soffes for contributing this. If you want to see it in action before you give it a try, check out Sam's blog.

Bug fixes

We've fixed several issues in the Redcarpet codebase in this release. Here are some of the highlights:

  • Fixed an issue where mixing code spans and emphasis mangled the output (#135 and #190)
  • Fixed an issue where nested parenthesis in a link didn't render correctly (#237)
  • Fixed an issue where FTP URIs were misidentified as email links when using autolinking (#170)
  • Fixed an issue where emphasis inside parenthesis was not parsed correctly (#256)
  • Fixed an issue where HTML comments were being needlessly escaped (#268)

Thanks to Robin Dupret for fixing all of these!

Wrapping this up

We're really excited about Redcarpet 3.0.0 and hope you enjoy using it as much as we enjoyed making it. If you have any issues, please feel free to file an issue and we'll take a look at it.

Thanks!