aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/CSS.hs
diff options
context:
space:
mode:
authorAlbert Krewinkel <[email protected]>2022-01-28 18:05:49 +0100
committerAlbert Krewinkel <[email protected]>2022-01-28 18:20:14 +0100
commita6fa3df1146f7aee4e3bfa4cf506ab44e38ecb35 (patch)
tree5da7601e160156f0bb4424ed4f60f53d6668181d /src/Text/Pandoc/CSS.hs
parentd36a16a4df5ed54b80dfc1579c339bad24ba6b0c (diff)
HTML writer: avoid duplicate "style" attributes on table cells
Fixes: #7871
Diffstat (limited to 'src/Text/Pandoc/CSS.hs')
-rw-r--r--src/Text/Pandoc/CSS.hs6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/Text/Pandoc/CSS.hs b/src/Text/Pandoc/CSS.hs
index ab31e3d5b..03065cc9b 100644
--- a/src/Text/Pandoc/CSS.hs
+++ b/src/Text/Pandoc/CSS.hs
@@ -18,6 +18,7 @@ module Text.Pandoc.CSS
)
where
+import Data.Either (fromRight)
import Data.Maybe (mapMaybe, listToMaybe)
import Data.Text (Text, pack)
import Text.Pandoc.Shared (trim)
@@ -37,10 +38,7 @@ styleAttrParser = many1 ruleParser
-- Returns an empty list on failure.
cssAttributes :: Text -> [(Text, Text)]
cssAttributes styleString =
- -- Use Data.Either.fromRight once GHC 8.0 is no longer supported
- case parse styleAttrParser "" styleString of
- Left _ -> []
- Right x -> x
+ fromRight [] $ parse styleAttrParser "" styleString
-- | takes a list of keys/properties and a CSS string and
-- returns the corresponding key-value-pairs.