aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Text/Pandoc/Readers/HTML.hs2
-rw-r--r--test/command/html-trim-definition-list-terms.md17
2 files changed, 18 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Readers/HTML.hs b/src/Text/Pandoc/Readers/HTML.hs
index dfc31f7af..c1478ebc4 100644
--- a/src/Text/Pandoc/Readers/HTML.hs
+++ b/src/Text/Pandoc/Readers/HTML.hs
@@ -336,7 +336,7 @@ pDefListItem = try $ do
terms <- many1 (try $ skipMany nonItem >> pInTags "dt" inline)
defs <- many1 (try $ skipMany nonItem >> pInTags "dd" block)
skipMany nonItem
- let term = foldl1 (\x y -> x <> B.linebreak <> y) terms
+ let term = foldl1 (\x y -> x <> B.linebreak <> y) $ map trimInlines terms
return (term, map (fixPlains True) defs)
fixPlains :: Bool -> Blocks -> Blocks
diff --git a/test/command/html-trim-definition-list-terms.md b/test/command/html-trim-definition-list-terms.md
new file mode 100644
index 000000000..08e58c73a
--- /dev/null
+++ b/test/command/html-trim-definition-list-terms.md
@@ -0,0 +1,17 @@
+```
+% pandoc -f html -t native
+<dl>
+ <dt>
+ foo
+ bar
+ </dt>
+ <dt>
+ baz
+ </dt>
+ <dd>test</dd>
+</dl>
+^D
+[DefinitionList
+ [([Str "foo",SoftBreak,Str "bar",LineBreak,Str "baz"],
+ [[Plain [Str "test"]]])]]
+```