mirror of
https://github.com/jgm/pandoc.git
synced 2026-09-12 18:45:58 +00:00
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.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user