aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Krotov <ilabdsf@gmail.com>2017-11-24 14:02:43 +0300
committerAlexander Krotov <ilabdsf@gmail.com>2017-11-24 14:02:43 +0300
commit77af25b4c3297cdd011a4c3c2755ffcac9807b7d (patch)
treebe8849df644ca315932453bed00649262fc8fdbe
parent137c7c2a657492c4652d1ebcaceea44ff69f262b (diff)
downloadpandoc-77af25b4c3297cdd011a4c3c2755ffcac9807b7d.tar.gz
Muse reader: parse markup in definition list terms
-rw-r--r--src/Text/Pandoc/Readers/Muse.hs6
-rw-r--r--test/Tests/Readers/Muse.hs2
2 files changed, 6 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Readers/Muse.hs b/src/Text/Pandoc/Readers/Muse.hs
index 6599ba059..c6a66a1ed 100644
--- a/src/Text/Pandoc/Readers/Muse.hs
+++ b/src/Text/Pandoc/Readers/Muse.hs
@@ -442,7 +442,8 @@ orderedList = try $ do
definitionListItem :: PandocMonad m => MuseParser m (F (Inlines, [Blocks]))
definitionListItem = try $ do
- term <- termParser
+ rawTerm <- termParser
+ term <- parseFromString (trimInlinesF . mconcat <$> many inline) rawTerm
many1 spaceChar
string "::"
firstLine <- many $ noneOf "\n"
@@ -450,7 +451,8 @@ definitionListItem = try $ do
let lns = firstLine : restLines
lineContent <- parseFromString (withListContext parseBlocks) $ concat lns ++ "\n"
pure $ do lineContent' <- lineContent
- pure (B.text term, [lineContent'])
+ term' <- term
+ pure (term', [lineContent'])
where
termParser = (guardDisabled Ext_amuse <|> void spaceChar) >> -- Initial space is required by Amusewiki, but not Emacs Muse
many spaceChar >>
diff --git a/test/Tests/Readers/Muse.hs b/test/Tests/Readers/Muse.hs
index 3d5ad1fb9..aa35e6063 100644
--- a/test/Tests/Readers/Muse.hs
+++ b/test/Tests/Readers/Muse.hs
@@ -756,6 +756,8 @@ tests =
definitionList [ ("Bar", [ para "baz" ]) ]
, "One-line definition list" =: " foo :: bar" =?>
definitionList [ ("foo", [ para "bar" ]) ]
+ , "Definition list term with emphasis" =: " *Foo* :: bar\n" =?>
+ definitionList [ (emph "Foo", [ para "bar" ]) ]
, "Multi-line definition lists" =:
T.unlines
[ " First term :: Definition of first term"