rdiscount enable parsing markdown within block html?

782 views Asked by At

Is there any global option for rdiscount to enable parsing markdown in block html tags? And any way to use that option within Octopress/Jekyll? This is the option that Kramdown supports:

parse_block_html Process kramdown syntax in block HTML tags If this option is true, the kramdown parser processes the content of block HTML tags as text containing block-level elements. Since this is not wanted normally, the default is false. It is normally better to selectively enable kramdown processing via the markdown attribute.

Default: false

Unfortunately, Jekyll does not pass this kramdown flag to kramdown. I opened an issue on that: https://github.com/mojombo/jekyll/issues/1095

1

There are 1 answers

2
David Foster On

No. There is no RDiscount option for this. All options are listed in the API docs here: http://rdoc.info/github/davidfstr/rdiscount/RDiscount

Here is a workaround for Jekyll/Octopress. Consider the following example:

<div>
    I want this to be in *Markdown*!
</div>

You can use the markdownify tag in Jekyll to manually force a section to be in Markdown:

<div>
    {% capture m %}I want this to be in *Markdown*!{% endcapture %}
    {{ m | markdownify }}
</div>