Skip to content
This repository has been archived by the owner on Apr 22, 2020. It is now read-only.

[FEATURE] Parse GitHub style code blocks #296

Closed
GoogleCodeExporter opened this issue Apr 22, 2015 · 1 comment
Closed

[FEATURE] Parse GitHub style code blocks #296

GoogleCodeExporter opened this issue Apr 22, 2015 · 1 comment

Comments

@GoogleCodeExporter
Copy link

GitHub uses classes to identify language, so e.g.

<pre><code class="ruby">
def foo
  puts "bar"
end
</code></pre>

Is it possible to add support to it somehow? Or there is a way to configure 
Prettify to detect language from this structure?

Original issue reported on code.google.com by hrgys...@gmail.com on 13 Jul 2013 at 12:14

@amroamroamro
Copy link
Contributor

This is mentioned in the README file:

So it supports language hints as class="lang-ruby" or class="language-ruby".

When it's not possible to specify classes (e.g. when converting markdown to html), you can use a preceding HTML comment or XML processing instruction to set language hint

<!--prettify lang=ruby-->

(see #250 (comment) for an example)

I'm closing this as duplicate of #224 (comment), since it seems to be asking for something similar.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants