aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Text/Pandoc/Shared.hs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Shared.hs b/src/Text/Pandoc/Shared.hs
index 215fbfde1..0e1c115ee 100644
--- a/src/Text/Pandoc/Shared.hs
+++ b/src/Text/Pandoc/Shared.hs
@@ -679,7 +679,11 @@ filterIpynbOutput mode = walk go
where go (Div (ident, ("output":os), kvs) bs) =
case mode of
Nothing -> Div (ident, ("output":os), kvs) []
- Just fmt -> Div (ident, ("output":os), kvs) $
+ -- "best" for ipynb includes all formats:
+ Just fmt
+ | fmt == Format "ipynb"
+ -> Div (ident, ("output":os), kvs) bs
+ | otherwise -> Div (ident, ("output":os), kvs) $
take 1 $ sortBy (comparing rank) bs
where
rank (RawBlock (Format "html") _)