git.iko.soy/typeable/pandoc
on master help sign in
Muse reader: enable <literal> tags even if amuse extension is enabled

Amusewiki disables <literal> tags for security reasons. If user wants similar behavior in pandoc, RawBlocks and RawInlines can be removed or replaced with filters.

commita01573692af91f54b5fe6670e4a07fb6a3935181 authorAlexander Krotov <ilabdsf@gmail.com> dateFri 2 Mar 2018, 12:52 (9 years ago) parent64f8c5d
2 files changed−11
src/Text/Pandoc/Readers/Muse.hs−2 test/Tests/Readers/Muse.hs−9
src/Text/Pandoc/Readers/Muse.hs−2
@@ -402,7 +402,6 @@ exampleTag = try $ do
402402
403403literalTag :: PandocMonad m => MuseParser m (F Blocks)
404404literalTag = do
405− guardDisabled Ext_amuse -- Text::Amuse does not support <literal>
406405 (return . rawBlock) <$> htmlBlock "literal"
407406 where
408407 -- FIXME: Emacs Muse inserts <literal> without style into all output formats, but we assume HTML
@@ -880,7 +879,6 @@ codeTag = do
880879
881880inlineLiteralTag :: PandocMonad m => MuseParser m (F Inlines)
882881inlineLiteralTag = do
883− guardDisabled Ext_amuse -- Text::Amuse does not support <literal>
884882 (return . rawInline) <$> htmlElement "literal"
885883 where
886884 -- FIXME: Emacs Muse inserts <literal> without style into all output formats, but we assume HTML
test/Tests/Readers/Muse.hs−9
@@ -207,9 +207,6 @@ tests =
207207 [ test emacsMuse "Inline literal"
208208 ("Foo<literal style=\"html\">lit</literal>bar" =?>
209209 para (text "Foo" <> rawInline "html" "lit" <> text "bar"))
210− , "No literal in Text::Amuse" =:
211− "Foo<literal style=\"html\">lit</literal>bar" =?>
212− para "Foo<literal style=\"html\">lit</literal>bar"
213210 ]
214211 ]
215212
@@ -475,12 +472,6 @@ tests =
475472 , "</literal>"
476473 ] =?>
477474 rawBlock "latex" "\\newpage")
478− , "No literal blocks in Text::Amuse" =:
479− T.unlines [ "<literal style=\"latex\">"
480− , "\\newpage"
481− , "</literal>"
482− ] =?>
483− para "<literal style=\"latex\">\n\\newpage\n</literal>"
484475 ]
485476 , "Center" =:
486477 T.unlines [ "<center>"