git.iko.soy/typeable/pandoc
on master help sign in
Docx reader: combine inlines properly in dropcaps.

Make sure that adjacent inlines are combined properly in dropcaps. This updates the test results as well.

commit45ec035e93ec0c32f9fb7d7f2f99ca17de73ebf9 authorJesse Rosenthal <jrosenthal@jhu.edu> dateMon 11 Aug 2014, 23:30 (12 years ago) parent0808449
2 files changed+3−3
src/Text/Pandoc/Readers/Docx.hs+1−1 tests/docx.drop_cap.native+2−2
src/Text/Pandoc/Readers/Docx.hs+1−1
@@ -462,7 +462,7 @@ bodyPartToBlocks (Paragraph pPr parparts)
462462bodyPartToBlocks (Paragraph pPr parparts) = do
463463 ils <- parPartsToInlines parparts >>= (return . normalizeSpaces)
464464 dropIls <- gets docxDropCap
465− let ils' = dropIls ++ ils
465+ let ils' = reduceList $ dropIls ++ ils
466466 if dropCap pPr
467467 then do modify $ \s -> s { docxDropCap = ils' }
468468 return []
tests/docx.drop_cap.native+2−2
@@ -1,4 +1,4 @@
1−[Para [Str "D",Str "rop",Space,Str "cap."]
1+[Para [Str "Drop",Space,Str "cap."]
22,Para [Str "Next",Space,Str "paragraph."]
3−,Para [Str "D",Str "rop",Space,Str "cap",Space,Str "in",Space,Str "margin."]
3+,Para [Str "Drop",Space,Str "cap",Space,Str "in",Space,Str "margin."]
44,Para [Str "Drop",Space,Str "cap",Space,Str "(not",Space,Str "really)."]]