git.iko.soy/typeable/pandoc
on master help sign in
Docx reader: Combine codeBlocks
b948ca6Jesse Rosenthal
src/Text/Pandoc/Readers/Docx/Combine.hs+4
@@ -135,6 +135,10 @@ combineBlocks bs cs
135 | bs' :> BlockQuote bs'' <- viewr (unMany bs)
135 | bs' :> BlockQuote bs'' <- viewr (unMany bs)
136 , BlockQuote cs'' :< cs' <- viewl (unMany cs) =
136 , BlockQuote cs'' :< cs' <- viewl (unMany cs) =
137 Many $ (bs' |> BlockQuote (bs'' <> cs'')) >< cs'
137 Many $ (bs' |> BlockQuote (bs'' <> cs'')) >< cs'
138+ | bs' :> CodeBlock attr codeStr <- viewr (unMany bs)
139+ , CodeBlock attr' codeStr' :< cs' <- viewl (unMany cs)
140+ , attr == attr' =
141+ Many $ (bs' |> CodeBlock attr (codeStr <> "\n" <> codeStr')) >< cs'
138combineBlocks bs cs = bs <> cs
142combineBlocks bs cs = bs <> cs
139
143
140instance (Monoid a, Eq a) => Eq (Modifier a) where
144instance (Monoid a, Eq a) => Eq (Modifier a) where