diff options
author | John MacFarlane <jgm@berkeley.edu> | 2010-06-28 19:47:29 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2010-06-28 19:49:07 -0700 |
commit | d0be7ca8cb080bbf47a5829e1bb7161726b491eb (patch) | |
tree | f4387c37f449a1b5e5432c112b4ee009b2ffdcbb /src/Text/Pandoc/Writers | |
parent | b5bda7569e700ff45582fe2d11993776451fd6fc (diff) |
Add birdtracks to lhs in HTML when compiled wo -fhighlighting.
Resolves Issue #242. Previously the bird tracks would be
stripped off when pandoc was not compiled with highlighting support,
even if -t html+lhs was specified.
Thanks to Nicholas Wu for pointing out the problem.
Diffstat (limited to 'src/Text/Pandoc/Writers')
-rw-r--r-- | src/Text/Pandoc/Writers/HTML.hs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs index 299471328..e62a06b4f 100644 --- a/src/Text/Pandoc/Writers/HTML.hs +++ b/src/Text/Pandoc/Writers/HTML.hs @@ -285,9 +285,12 @@ blockToHtml opts (CodeBlock (id',classes,keyvals) rawCode) = do attrs = [theclass (unwords classes') | not (null classes')] ++ [prefixedId opts id' | not (null id')] ++ map (\(x,y) -> strAttr x y) keyvals + addBird = if "literate" `elem` classes + then unlines . map ("> " ++) . lines + else unlines . lines in return $ pre ! attrs $ thecode << (replicate (length leadingBreaks) br +++ - [stringToHtml $ rawCode' ++ "\n"]) + [stringToHtml $ addBird rawCode']) Right h -> modify (\st -> st{ stHighlighting = True }) >> return h blockToHtml opts (BlockQuote blocks) = -- in S5, treat list in blockquote specially |