From 707eef34b74e64174ca0af3373a04176b7860f18 Mon Sep 17 00:00:00 2001
From: John MacFarlane <jgm@berkeley.edu>
Date: Wed, 6 Mar 2019 10:00:18 -0800
Subject: Shared.filterIpynbOutput: 'best' should include everything for ipynb.

---
 src/Text/Pandoc/Shared.hs | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

(limited to 'src')

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") _)
-- 
cgit v1.2.3