aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers
diff options
context:
space:
mode:
Diffstat (limited to 'src/Text/Pandoc/Writers')
-rw-r--r--src/Text/Pandoc/Writers/Ipynb.hs13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/Text/Pandoc/Writers/Ipynb.hs b/src/Text/Pandoc/Writers/Ipynb.hs
index 661f585f4..0babf7112 100644
--- a/src/Text/Pandoc/Writers/Ipynb.hs
+++ b/src/Text/Pandoc/Writers/Ipynb.hs
@@ -213,10 +213,9 @@ extractData bs = do
pairsToJSONMeta :: [(String, String)] -> JSONMeta
pairsToJSONMeta kvs =
- M.fromList [(T.pack k, case v of
- "true" -> Bool True
- "false" -> Bool False
- _ -> case safeRead v of
- Just n -> Number n
- _ -> String (T.pack v))
- | (k,v) <- kvs , k /= "execution_count" ]
+ M.fromList [(T.pack k, case Aeson.decode (UTF8.fromStringLazy v) of
+ Just val -> val
+ Nothing -> String (T.pack v))
+ | (k,v) <- kvs
+ , k /= "execution_count"
+ ]