aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers/Ipynb.hs
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2019-03-30 09:57:43 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2019-03-30 09:57:43 -0700
commit79c82a2550977e391ca60820b6013d23d444bf39 (patch)
treed60ca702f56b678cefa576549088e303f2bf0f04 /src/Text/Pandoc/Readers/Ipynb.hs
parent036179e44a73e27563f6365b8c8dd331f10ed7fc (diff)
downloadpandoc-79c82a2550977e391ca60820b6013d23d444bf39.tar.gz
ipynb reader/writer: use format 'ipynb' for raw cell where no format given.
According to nbformat docs, this is supposed to render in every format. We don't do that, but we at least preserve it as a raw block in markdown, so you can round-trip.
Diffstat (limited to 'src/Text/Pandoc/Readers/Ipynb.hs')
-rw-r--r--src/Text/Pandoc/Readers/Ipynb.hs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Readers/Ipynb.hs b/src/Text/Pandoc/Readers/Ipynb.hs
index 10f3a0675..04e0b1595 100644
--- a/src/Text/Pandoc/Readers/Ipynb.hs
+++ b/src/Text/Pandoc/Readers/Ipynb.hs
@@ -90,10 +90,11 @@ cellToBlocks opts lang c = do
return $ B.divWith ("",["cell","markdown"],kvs)
$ B.fromList bs
Ipynb.Raw -> do
- let format = fromMaybe "html" $ lookup "format" kvs
+ -- we use ipynb to indicate no format given (a wildcard in nbformat)
+ let format = fromMaybe "ipynb" $ lookup "format" kvs
let format' =
case format of
- "text/html" -> "html"
+ "text/html" -> "html"
"text/latex" -> "latex"
"application/pdf" -> "latex"
"text/markdown" -> "markdown"