diff options
author | Alexander Krotov <ilabdsf@gmail.com> | 2018-03-07 19:11:03 +0300 |
---|---|---|
committer | Alexander Krotov <ilabdsf@gmail.com> | 2018-03-07 19:11:03 +0300 |
commit | f8608b418afcb1cfe8ccb55abf31f33f7bc7efb3 (patch) | |
tree | e8b84353bf541bf079623f5e944449b77c6ef551 /src/Text | |
parent | f8e255053de09786c6c251e38387663750ddd3ac (diff) | |
download | pandoc-f8608b418afcb1cfe8ccb55abf31f33f7bc7efb3.tar.gz |
Muse writer: expand Cite before list normalization
Diffstat (limited to 'src/Text')
-rw-r--r-- | src/Text/Pandoc/Writers/Muse.hs | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/Text/Pandoc/Writers/Muse.hs b/src/Text/Pandoc/Writers/Muse.hs index 7a9bc8130..156958ab7 100644 --- a/src/Text/Pandoc/Writers/Muse.hs +++ b/src/Text/Pandoc/Writers/Muse.hs @@ -292,11 +292,16 @@ conditionalEscapeString s = then escapeString s else s --- Expand Math before normalizing inline list +-- Expand Math and Cite before normalizing inline list preprocessInlineList :: PandocMonad m => [Inline] -> m [Inline] preprocessInlineList (Math t str:xs) = (++) <$> texMathToInlines t str <*> preprocessInlineList xs +-- Amusewiki does not support <cite> tag, +-- and Emacs Muse citation support is limited +-- (https://www.gnu.org/software/emacs-muse/manual/html_node/Citations.html#Citation) +-- so just fallback to expanding inlines. +preprocessInlineList (Cite _ lst:xs) = (lst ++) <$> preprocessInlineList xs preprocessInlineList (x:xs) = (x:) <$> preprocessInlineList xs preprocessInlineList [] = return [] @@ -371,11 +376,8 @@ inlineToMuse (Quoted SingleQuote lst) = do inlineToMuse (Quoted DoubleQuote lst) = do contents <- inlineListToMuse lst return $ "“" <> contents <> "”" --- Amusewiki does not support <cite> tag, --- and Emacs Muse citation support is limited --- (https://www.gnu.org/software/emacs-muse/manual/html_node/Citations.html#Citation) --- so just fallback to expanding inlines. -inlineToMuse (Cite _ lst) = inlineListToMuse lst +inlineToMuse (Cite {}) = + fail "Citations should be expanded before normalization" inlineToMuse (Code _ str) = return $ "<code>" <> text (substitute "</code>" "<</code><code>/code>" str) <> "</code>" inlineToMuse Math{} = |