@@ -32,7 +32,7 @@ TODO:
3232- {{{ }}} syntax for <example>
3333- Page breaks (five "*")
3434- Headings with anchors (make it round trip with Muse writer)
35−- <verse> and ">"
35+- Verse markup (">")
3636- Org tables
3737- table.el tables
3838- Images with attributes (floating and width)
@@ -180,6 +180,7 @@ blockElements = choice [ comment
180180 , centerTag
181181 , rightTag
182182 , quoteTag
183+ , verseTag
183184 , bulletList
184185 , orderedList
185186 , definitionList
@@ -244,6 +245,25 @@ rightTag = blockTag id "right"
244245quoteTag :: PandocMonad m => MuseParser m (F Blocks)
245246quoteTag = withQuoteContext InDoubleQuote $ blockTag B.blockQuote "quote"
246247
248+verseLine :: PandocMonad m => MuseParser m String
249+verseLine = do
250+ line <- anyLine <|> many1Till anyChar eof
251+ let (white, rest) = span (== ' ') line
252+ return $ replicate (length white) '\160' ++ rest
253+
254+verseLines :: PandocMonad m => MuseParser m (F Blocks)
255+verseLines = do
256+ optionMaybe blankline -- Skip blankline after opening tag on separate line
257+ lns <- many verseLine
258+ lns' <- mapM (parseFromString' (trimInlinesF . mconcat <$> many inline)) lns
259+ return $ B.lineBlock <$> sequence lns'
260+
261+verseTag :: PandocMonad m => MuseParser m (F Blocks)
262+verseTag = do
263+ (_, content) <- htmlElement "verse"
264+ parsedContent <- parseFromString verseLines content
265+ return parsedContent
266+
247267commentTag :: PandocMonad m => MuseParser m (F Blocks)
248268commentTag = parseHtmlContent "comment" anyChar >> return mempty
249269