diff --git a/src/Text/Pandoc/Writers/Docbook.hs b/src/Text/Pandoc/Writers/Docbook.hs index d025b7ac2..3916aa214 100644 --- a/src/Text/Pandoc/Writers/Docbook.hs +++ b/src/Text/Pandoc/Writers/Docbook.hs @@ -158,7 +158,7 @@ blockToDocbook options (Para lst) = blockToDocbook options (BlockQuote blocks) = indentedInTags options "blockquote" (blocksToDocbook options blocks) blockToDocbook options (CodeBlock str) = - text "" <> (cdata str) <> text "" + text "\n" <> text (codeStringToXML str) <> text "\n" blockToDocbook options (BulletList lst) = indentedInTags options "itemizedlist" $ listItemsToDocbook options lst blockToDocbook options (OrderedList lst) = diff --git a/tests/writer.docbook b/tests/writer.docbook index 2736bde74..3b3d661a3 100644 --- a/tests/writer.docbook +++ b/tests/writer.docbook @@ -87,9 +87,11 @@ Code in a block quote: - +sub status { print "working"; -}]]> +} + A list: @@ -129,9 +131,11 @@ Example: - +sub status { print "working"; -}]]> +} +
@@ -169,19 +173,23 @@ Code: - +---- (should be four hyphens) sub status { print "working"; } -this code block is indented by one tab]]> +this code block is indented by one tab + And: - + this code block is indented by two tabs -These should not be escaped: \$ \\ \> \[ \{]]> +These should not be escaped: \$ \\ \> \[ \{ +
Lists @@ -839,7 +847,9 @@ Cat & 1 \\ \hline This should [not][] be a link. - + +[not]: /url + Foo bar. @@ -901,7 +911,9 @@ Cat & 1 \\ \hline Auto-links should not occur here: <http://example.com/> - ]]> + +or here: <http://example.com/> +
@@ -950,7 +962,9 @@ Cat & 1 \\ \hline Subsequent blocks are indented to show that they belong to the footnote (as with list items). - }]]> + + { <code> } + If you want, you can indent every line, but you can also be lazy and just indent the first line of each block.