Add option to Redcarpet::Render::HTML to emit style classes for google-code-prettify #192

Closed
wants to merge 10 commits into
from

Conversation

Projects
None yet
1 participant
Contributor

jolros commented Jan 25, 2013

I've added an option to the HTML renderer to add "prettyprint" classes to <code> blocks so that they can be formatted with google-code-prettify (http://code.google.com/p/google-code-prettify/).

I've changed the documentation, and added a unit test.

With a renderer instantiated like this:

rnder = Redcarpet::Render::HTML.new(:prettify => true)
mkdwn = Redcarpet::Markdown.new(rnder, :no_intra_emphasis => true, :fenced_code_blocks => true, :space_after_headers => true)
mkdwn.render(text)

Code blocks will end up looking like this:

<pre><code class="prettyprint">
…
</code></pre>

robin850 closed this in 9132288 Apr 7, 2013

@robin850 robin850 added a commit that referenced this pull request Oct 7, 2013

@robin850 robin850 Move the prettify test to the HTML render tests
Test introduced by #192 wasn't located in the good file.
68d4d1a

@robin850 robin850 added a commit that referenced this pull request Oct 7, 2013

@robin850 robin850 Improve prettify feature testing
Actually, the test introduced by #192 for this ferature wasn't
covering anything since the backticks were escaped so the output
was generate by the codespan callback.

This commit should test this feature almost correctly and reflect
changes done in #314.
bf44c83
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment