git.iko.soy/typeable/pandoc
on master help sign in
HTML writer: if language specified for code block, print as <code> class.

git-svn-id: https://pandoc.googlecode.com/svn/trunk@1202 788f1e2b-df1e-0410-8736-df70ead52e1b

commit769e2f3cf591c4f03fc6991482a406275ea57085 authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> dateSat 9 Feb 2008, 03:18 (19 years ago) parentfa0ab86
1 file changed+2−1
Text/Pandoc/Writers/HTML.hs+2−1
Text/Pandoc/Writers/HTML.hs+2−1
@@ -263,7 +263,8 @@ blockToHtml opts (Plain lst) = inlineListToHtml opts lst
263263blockToHtml opts (Para lst) = inlineListToHtml opts lst >>= (return . paragraph)
264264blockToHtml opts (RawHtml str) = return $ primHtml str
265265blockToHtml opts (HorizontalRule) = return $ hr
266−blockToHtml opts (CodeBlock _ str) = return $ pre $ thecode << (str ++ "\n")
266+blockToHtml opts (CodeBlock lang str) = return $ pre $
267+ thecode ! (if null lang then [] else [theclass lang]) << (str ++ "\n")
267268 -- the final \n for consistency with Markdown.pl
268269blockToHtml opts (BlockQuote blocks) =
269270 -- in S5, treat list in blockquote specially