From c9460e7013d395f77f75a4eb6bde933ffc34b6b6 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Thu, 13 Oct 2016 08:46:44 +0200 Subject: Parse line-oriented markup as LineBlock Markup-features focusing on lines as distinctive part of the markup are read into `LineBlock` elements. This currently means line blocks in reStructuredText and Markdown (the latter only if the `line_block` extension is enabled), the `linegroup`/`line` combination from the Docbook 5.1 working draft, and Org-mode `VERSE` blocks. --- src/Text/Pandoc/Readers/DocBook.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/Text/Pandoc/Readers/DocBook.hs') diff --git a/src/Text/Pandoc/Readers/DocBook.hs b/src/Text/Pandoc/Readers/DocBook.hs index 336b40933..4d8d5ab94 100644 --- a/src/Text/Pandoc/Readers/DocBook.hs +++ b/src/Text/Pandoc/Readers/DocBook.hs @@ -592,8 +592,6 @@ checkInMeta p = do when accepts p return mempty - - addMeta :: ToMetaValue a => String -> a -> DB () addMeta field val = modify (setMeta field val) @@ -612,7 +610,7 @@ isBlockElement (Elem e) = qName (elName e) `elem` blocktags "important","caution","note","tip","warning","qandadiv", "question","answer","abstract","itemizedlist","orderedlist", "variablelist","article","book","table","informaltable", - "informalexample", + "informalexample", "linegroup", "screen","programlisting","example","calloutlist"] isBlockElement _ = False @@ -779,6 +777,7 @@ parseBlock (Elem e) = "informaltable" -> parseTable "informalexample" -> divWith ("", ["informalexample"], []) <$> getBlocks e + "linegroup" -> lineBlock <$> lineItems "literallayout" -> codeBlockWithLang "screen" -> codeBlockWithLang "programlisting" -> codeBlockWithLang @@ -900,6 +899,7 @@ parseBlock (Elem e) = let ident = attrValue "id" e modify $ \st -> st{ dbSectionLevel = n - 1 } return $ headerWith (ident,[],[]) n' headerText <> b + lineItems = mapM getInlines $ filterChildren (named "line") e metaBlock = acceptingMetadata (getBlocks e) >> return mempty getInlines :: Element -> DB Inlines -- cgit v1.2.3