aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlbert Krewinkel <[email protected]>2022-08-22 09:37:37 +0200
committerAlbert Krewinkel <[email protected]>2022-08-22 12:53:57 +0200
commit90610eb78c3fcd9b943fd2e4d7730149248250d8 (patch)
tree310a651e2295c6360c8b7f5e7556b5b30bd71e0f /src
parenta31cf9a005f3d7dcd3f5d16262f40d8b3e406776 (diff)
Org writer: prefix code language of ipynb code blocks with `jupyter-`.
This is the convention used by the *emacs-jupyter* package.
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Writers/Org.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Writers/Org.hs b/src/Text/Pandoc/Writers/Org.hs
index 772e13d5c..a749e48af 100644
--- a/src/Text/Pandoc/Writers/Org.hs
+++ b/src/Text/Pandoc/Writers/Org.hs
@@ -161,7 +161,9 @@ blockToOrg (CodeBlock (ident,classes,kvs) str) = do
let at = map pandocLangToOrg classes `intersect` orgLangIdentifiers
let lang = case at of
[] -> Nothing
- l:_ -> Just l
+ l:_ -> if "code" `elem` classes -- check for ipynb code cell
+ then Just ("jupyter-" <> l)
+ else Just l
let args = mconcat $
[ " :" <> k <> " " <> v
| (k, v) <- kvs, k `notElem` ["startFrom", "org-language"]]