diff options
author | John MacFarlane <jgm@berkeley.edu> | 2017-12-08 12:16:32 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2017-12-10 21:13:05 -0800 |
commit | 5e039d913f0f8db2e7fc8ea37dee30b174c4594f (patch) | |
tree | 3a677fb02c7e8e20dda8ba69ba553cc85c19b38c /src/Text | |
parent | 1cd785fe33231a15423dea7d26cb9a7d770a7ace (diff) | |
download | pandoc-5e039d913f0f8db2e7fc8ea37dee30b174c4594f.tar.gz |
Changes for skylighting-0.5.
This fixes a bug in 2.0.4, whereby pandoc could not
read the theme files generated with `--print-highlight-style`.
It also fixes some CSS issues involving line numbers.
Highlighted code blocks are now enclosed in a div with class
sourceCode.
Highlighting CSS no longer sets a generic color for pre
and code; we only set these for class `sourceCode`.
This will close #4133 and #4128.
Diffstat (limited to 'src/Text')
-rw-r--r-- | src/Text/Pandoc/App.hs | 3 | ||||
-rw-r--r-- | src/Text/Pandoc/Writers/Docx.hs | 6 | ||||
-rw-r--r-- | src/Text/Pandoc/Writers/Ms.hs | 4 |
3 files changed, 7 insertions, 6 deletions
diff --git a/src/Text/Pandoc/App.hs b/src/Text/Pandoc/App.hs index 7d7d630ea..ae62db4f9 100644 --- a/src/Text/Pandoc/App.hs +++ b/src/Text/Pandoc/App.hs @@ -1074,7 +1074,8 @@ options = (map T.pack ["text-color" ,"background-color" - ,"line-numbers" + ,"line-number-color" + ,"line-number-background-color" ,"bold" ,"italic" ,"underline" diff --git a/src/Text/Pandoc/Writers/Docx.hs b/src/Text/Pandoc/Writers/Docx.hs index c9eaaf838..d76990284 100644 --- a/src/Text/Pandoc/Writers/Docx.hs +++ b/src/Text/Pandoc/Writers/Docx.hs @@ -625,12 +625,12 @@ styleToOpenXml sm style = [ mknode "w:u" [] () | tokFeature tokenUnderline toktype ] ] tokStyles = tokenStyles style - tokFeature f toktype = maybe False f $ lookup toktype tokStyles + tokFeature f toktype = maybe False f $ M.lookup toktype tokStyles tokCol toktype = maybe "auto" (drop 1 . fromColor) - $ (tokenColor =<< lookup toktype tokStyles) + $ (tokenColor =<< M.lookup toktype tokStyles) `mplus` defaultColor style tokBg toktype = maybe "auto" (drop 1 . fromColor) - $ (tokenBackground =<< lookup toktype tokStyles) + $ (tokenBackground =<< M.lookup toktype tokStyles) `mplus` backgroundColor style parStyle | hasStyleName "Source Code" (sParaStyleMap sm) = Nothing | otherwise = Just $ diff --git a/src/Text/Pandoc/Writers/Ms.hs b/src/Text/Pandoc/Writers/Ms.hs index 223d1bcc1..30633cec6 100644 --- a/src/Text/Pandoc/Writers/Ms.hs +++ b/src/Text/Pandoc/Writers/Ms.hs @@ -586,7 +586,7 @@ styleToMs sty = vcat $ colordefs ++ map (toMacro sty) alltoktypes allcolors = catMaybes $ ordNub $ [defaultColor sty, backgroundColor sty, lineNumberColor sty, lineNumberBackgroundColor sty] ++ - concatMap (colorsForToken. snd) (tokenStyles sty) + concatMap (colorsForToken. snd) (Map.toList (tokenStyles sty)) colorsForToken ts = [tokenColor ts, tokenBackground ts] hexColor :: Color -> String @@ -611,7 +611,7 @@ toMacro sty toktype = resetfont = if tokBold || tokItalic then text "\\\\f[C]" else empty - tokSty = lookup toktype (tokenStyles sty) + tokSty = Map.lookup toktype (tokenStyles sty) tokCol = (tokSty >>= tokenColor) `mplus` defaultColor sty -- tokBg = (tokSty >>= tokenBackground) `mplus` backgroundColor sty tokBold = fromMaybe False (tokenBold <$> tokSty) |