skylighting 0.1.1.2 → 0.1.1.3
raw patch · 4 files changed
+14/−7 lines, 4 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- changelog.md +6/−0
- skylighting.cabal +1/−1
- src/Skylighting/Format/LaTeX.hs +5/−4
- test/test-skylighting.hs +2/−2
changelog.md view
@@ -29,3 +29,9 @@ * Fixed a bug in WordDetect handling which caused it to drop input (#2). +## 0.1.1.3 -- 2017-01-29++* Increase test timeout to 6s.+* Avoid double {{}} in latex macros.+* Fixed problem compiling Format.LaTeX on older ghc versions (7.8.3)+ that can't take a Text as PrintfArg.
skylighting.cabal view
@@ -1,5 +1,5 @@ name: skylighting-version: 0.1.1.2+version: 0.1.1.3 synopsis: syntax highlighting library description: Skylighting is a syntax highlighting library with support for over one hundred languages. It derives
src/Skylighting/Format/LaTeX.hs view
@@ -104,7 +104,7 @@ macrodef :: Maybe Color -> [(TokenType, TokenStyle)] -> TokenType -> Text macrodef defaultcol tokstyles tokt = "\\newcommand{\\" <> Text.pack (show tokt) <>- "}[1]{" <> (co . ul . bf . it . bg $ "{#1}") <> "}"+ "}[1]{" <> (co . ul . bf . it . bg $ "#1") <> "}" where tokf = case lookup tokt tokstyles of Nothing -> defStyle Just x -> x@@ -118,9 +118,10 @@ then "\\textbf{" <> x <> "}" else x bcol = fromColor `fmap` tokenBackground tokf :: Maybe (Double, Double, Double)- bg x = case bcol of- Nothing -> x- Just (r, g, b) -> Text.pack $+ bg x = Text.pack $+ case bcol of+ Nothing -> x+ Just (r, g, b) -> printf "\\colorbox[rgb]{%0.2f,%0.2f,%0.2f}{%s}" r g b x col = fromColor `fmap` (tokenColor tokf `mplus` defaultcol) :: Maybe (Double, Double, Double)
test/test-skylighting.hs view
@@ -116,7 +116,7 @@ notBoth _ = True noDropTest :: Text -> Syntax -> TestTree-noDropTest inp syntax = localOption (mkTimeout 1000000) $+noDropTest inp syntax = localOption (mkTimeout 6000000) $ testCase (Text.unpack (sName syntax)) $ case tokenize defConfig syntax inp of Right ts -> assertBool ("Text has been dropped:\n" ++ diffs)@@ -127,7 +127,7 @@ Left e -> assert ("Unexpected error: " ++ e) tokenizerTest :: Bool -> FilePath -> TestTree-tokenizerTest regen inpFile = localOption (mkTimeout 1000000) $+tokenizerTest regen inpFile = localOption (mkTimeout 6000000) $ goldenTest testname getExpected getActual (compareValues referenceFile) updateGolden where testname = lang ++ " tokenizing of " ++ inpFile