diff options
author | Alexander Krotov <ilabdsf@gmail.com> | 2017-09-10 22:35:52 +0300 |
---|---|---|
committer | Alexander Krotov <ilabdsf@gmail.com> | 2017-09-11 18:17:28 +0300 |
commit | 508c3a64d823989dc6613ac7656851989530af65 (patch) | |
tree | 8f4d488d8b85b85fc8ae94f5f966f757b0ca5bfa /src | |
parent | 7df095f049d8499972af966d4622d20b5a465900 (diff) | |
download | pandoc-508c3a64d823989dc6613ac7656851989530af65.tar.gz |
Muse reader: parse {{{ }}} example syntax
Diffstat (limited to 'src')
-rw-r--r-- | src/Text/Pandoc/Readers/Muse.hs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Readers/Muse.hs b/src/Text/Pandoc/Readers/Muse.hs index ab9a51bad..b061d2dfc 100644 --- a/src/Text/Pandoc/Readers/Muse.hs +++ b/src/Text/Pandoc/Readers/Muse.hs @@ -30,7 +30,6 @@ Conversion of Muse text to 'Pandoc' document. -} {- TODO: -- {{{ }}} syntax for <example> - Page breaks (five "*") - Headings with anchors (make it round trip with Muse writer) - Org tables @@ -177,6 +176,7 @@ blockElements :: PandocMonad m => MuseParser m (F Blocks) blockElements = choice [ comment , separator , header + , example , exampleTag , literal , centerTag @@ -221,6 +221,13 @@ header = try $ do attr <- registerHeader ("", [], []) (runF content defaultParserState) return $ B.headerWith attr level <$> content +example :: PandocMonad m => MuseParser m (F Blocks) +example = try $ do + string "{{{" + optionMaybe blankline + contents <- manyTill anyChar $ try (optionMaybe blankline >> string "}}}") + return $ return $ B.codeBlock contents + exampleTag :: PandocMonad m => MuseParser m (F Blocks) exampleTag = do (attr, contents) <- htmlElement "example" |