Add a data-lang attribute to code blocks

This commit is contained in:
Roland Warmerdam
2013-05-09 22:03:44 +12:00
parent 0c04e5d55b
commit 2a6c722e78
2 changed files with 4 additions and 4 deletions

View File

@@ -5,7 +5,7 @@ module Jekyll
module CommonMethods
def add_code_tags(code, lang)
code = code.sub(/<pre>/, "<pre><code class=\"#{lang} language-#{lang}\">")
code = code.sub(/<pre>/, "<pre><code class=\"#{lang} language-#{lang}\" data-lang=\"#{lang}\">")
code = code.sub(/<\/pre>/,"</code></pre>")
end
end