aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Text/Pandoc/Readers/DocBook.hs7
-rw-r--r--tests/docbook-reader.docbook3
-rw-r--r--tests/docbook-reader.native1
3 files changed, 10 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
diff --git a/tests/docbook-reader.docbook b/tests/docbook-reader.docbook
index c76925917..aef632fb1 100644
--- a/tests/docbook-reader.docbook
+++ b/tests/docbook-reader.docbook
@@ -89,6 +89,9 @@ sub status {
print &quot;working&quot;;
}
</programlisting>
+ <screen>
+% <command>ls</command>
+</screen>
<para>
A list:
</para>
diff --git a/tests/docbook-reader.native b/tests/docbook-reader.native
index 2d29bb154..583b016bb 100644
--- a/tests/docbook-reader.native
+++ b/tests/docbook-reader.native
@@ -23,6 +23,7 @@ Pandoc (Meta {unMeta = fromList [("author",MetaList [MetaInlines [Str "John",Spa
,BlockQuote
[Para [Str "Code",Space,Str "in",Space,Str "a",Space,Str "block",Space,Str "quote:"]
,CodeBlock ("",[],[]) "sub status {\n print \"working\";\n}"
+ ,CodeBlock ("",[],[]) "% ls"
,Para [Str "A",Space,Str "list:"]
,OrderedList (1,Decimal,DefaultDelim)
[[Para [Str "item",Space,Str "one"]]