aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2020-12-30 16:04:09 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2020-12-30 16:04:09 -0800
commit0782d5882c8c04fbdffcb7026457b3cc79150692 (patch)
tree6fc301df72fd3c800096818c85621d51ad2e0299
parent419190213a7e6b07e2ac66f47d53e9f023af757d (diff)
downloadpandoc-0782d5882c8c04fbdffcb7026457b3cc79150692.tar.gz
Undo the "Use fromRight" hlint hint.
-rw-r--r--.hlint.yaml4
-rw-r--r--src/Text/Pandoc/Writers/Docx.hs3
2 files changed, 5 insertions, 2 deletions
diff --git a/.hlint.yaml b/.hlint.yaml
index 09fd9baf7..6b74014d4 100644
--- a/.hlint.yaml
+++ b/.hlint.yaml
@@ -104,5 +104,9 @@
- Text.Pandoc.Readers.Markdown
- Text.Pandoc.Readers.RST
+# fromRight is only in base >= 4.10
+- ignore:
+ name: "Use fromRight"
+
# Define some custom infix operators
# - fixity: infixr 3 ~^#^~
diff --git a/src/Text/Pandoc/Writers/Docx.hs b/src/Text/Pandoc/Writers/Docx.hs
index 1818ed81d..65946ec88 100644
--- a/src/Text/Pandoc/Writers/Docx.hs
+++ b/src/Text/Pandoc/Writers/Docx.hs
@@ -28,7 +28,6 @@ import Data.Char (isSpace, isLetter)
import Data.List (intercalate, isPrefixOf, isSuffixOf)
import Data.String (fromString)
import qualified Data.Map as M
-import Data.Either (fromRight)
import Data.Maybe (fromMaybe, isNothing, mapMaybe, maybeToList)
import qualified Data.Set as Set
import qualified Data.Text as T
@@ -1403,7 +1402,7 @@ inlineToOpenXML' opts (Image attr@(imgident, _, _) alt (src, title)) = do
generateImgElt (ident, _, _, img) =
let
(xpt,ypt) = desiredSizeInPoints opts attr
- (fromRight def (imageSize opts img))
+ (either (const def) id (imageSize opts img))
-- 12700 emu = 1 pt
(xemu,yemu) = fitToPage (xpt * 12700, ypt * 12700)
(pageWidth * 12700)