aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Text/Pandoc/Writers/Docbook.hs12
-rw-r--r--tests/writer.docbook2
2 files changed, 4 insertions, 10 deletions
diff --git a/src/Text/Pandoc/Writers/Docbook.hs b/src/Text/Pandoc/Writers/Docbook.hs
index e1b62f02d..1a8e58354 100644
--- a/src/Text/Pandoc/Writers/Docbook.hs
+++ b/src/Text/Pandoc/Writers/Docbook.hs
@@ -185,9 +185,7 @@ blockToDocbook _ (CodeBlock (_,classes,_) str) =
else languagesByExtension . map toLower $ s
langs = concatMap langsFrom classes
blockToDocbook opts (BulletList lst) =
- let attribs = case lst of
- ((Plain _:_):_) -> [("spacing", "compact")]
- _ -> []
+ let attribs = [("spacing", "compact") | isTightList lst]
in inTags True "itemizedlist" attribs $ listItemsToDocbook opts lst
blockToDocbook _ (OrderedList _ []) = empty
blockToDocbook opts (OrderedList (start, numstyle, _) (first:rest)) =
@@ -199,9 +197,7 @@ blockToDocbook opts (OrderedList (start, numstyle, _) (first:rest)) =
LowerAlpha -> [("numeration", "loweralpha")]
UpperRoman -> [("numeration", "upperroman")]
LowerRoman -> [("numeration", "lowerroman")]
- spacing = case first of
- (Plain _:_) -> [("spacing", "compact")]
- _ -> []
+ spacing = [("spacing", "compact") | isTightList (first:rest)]
attribs = numeration ++ spacing
items = if start == 1
then listItemsToDocbook opts (first:rest)
@@ -210,9 +206,7 @@ blockToDocbook opts (OrderedList (start, numstyle, _) (first:rest)) =
listItemsToDocbook opts rest
in inTags True "orderedlist" attribs items
blockToDocbook opts (DefinitionList lst) =
- let attribs = case lst of
- ((_, (Plain _:_):_):_) -> [("spacing", "compact")]
- _ -> []
+ let attribs = [("spacing", "compact") | isTightList $ concatMap snd lst]
in inTags True "variablelist" attribs $ deflistItemsToDocbook opts lst
blockToDocbook _ (RawBlock f str)
| f == "docbook" = text str -- raw XML block
diff --git a/tests/writer.docbook b/tests/writer.docbook
index 26dcbadaa..01daa2c30 100644
--- a/tests/writer.docbook
+++ b/tests/writer.docbook
@@ -508,7 +508,7 @@ These should not be escaped: \$ \\ \> \[ \{
</sect2>
<sect2 id="fancy-list-markers">
<title>Fancy list markers</title>
- <orderedlist numeration="arabic" spacing="compact">
+ <orderedlist numeration="arabic">
<listitem override="2">
<para>
begins with 2