aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2014-07-23 10:06:36 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2014-07-23 10:06:36 -0700
commit9c3f7688ee1c44c5452cb30986f1e37317acb6e2 (patch)
treefc0bebc2dc0ca75b823a016630d0c0e041ef6b1d /src/Text/Pandoc
parent5089bc8fe29949500443205bb0f91177d0af59dc (diff)
downloadpandoc-9c3f7688ee1c44c5452cb30986f1e37317acb6e2.tar.gz
DocBook reader: Better handle elements inside code environments.
Of course, we can't include structure in the code block, but this way we at least preserve the text. Closes #1449.
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r--src/Text/Pandoc/Readers/DocBook.hs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Readers/DocBook.hs b/src/Text/Pandoc/Readers/DocBook.hs
index cf1d5132e..1e119e729 100644
--- a/src/Text/Pandoc/Readers/DocBook.hs
+++ b/src/Text/Pandoc/Readers/DocBook.hs
@@ -769,7 +769,12 @@ parseBlock (Elem e) =
"" -> []
x -> [x]
return $ codeBlockWith (attrValue "id" e, classes', [])
- $ trimNl $ strContent e
+ $ trimNl $ strContentRecursive e
+ strContentRecursive = strContent . (\e' -> e'{ elContent =
+ map elementToStr $ elContent e' })
+ elementToStr :: Content -> Content
+ elementToStr (Elem e') = Text $ CData CDataText (strContentRecursive e') Nothing
+ elementToStr x = x
parseBlockquote = do
attrib <- case filterChild (named "attribution") e of
Nothing -> return mempty