summaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/CSS.hs
diff options
context:
space:
mode:
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.