aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers/DocBook.hs
diff options
context:
space:
mode:
authorAlbert Krewinkel <albert@zeitkraut.de>2016-10-13 08:46:44 +0200
committerAlbert Krewinkel <albert@zeitkraut.de>2016-10-13 08:46:44 +0200
commitc9460e7013d395f77f75a4eb6bde933ffc34b6b6 (patch)
tree995d6d9786efef38130962430bd76a6e9fb564f2 /src/Text/Pandoc/Readers/DocBook.hs
parent22cb9e3327ff4aea6109c048a185506e67f07ef1 (diff)
downloadpandoc-c9460e7013d395f77f75a4eb6bde933ffc34b6b6.tar.gz
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.
Diffstat (limited to 'src/Text/Pandoc/Readers/DocBook.hs')
-rw-r--r--src/Text/Pandoc/Readers/DocBook.hs6
1 files changed, 3 insertions, 3 deletions
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