git.iko.soy/typeable/pandoc
on master help sign in
Fixing wrong numbered-list indentation in open document format
commit0b49f810f401b9154b50727d2179d1ec39cd8d3e authorAlexander Kondratskiy <kholdstare0.0@gmail.com> dateSun 14 Jul 2013, 14:33 (13 years ago) parent15984ad
2 files changed+26−24
src/Text/Pandoc/Writers/OpenDocument.hs+7−5 tests/writer.opendocument+19−19
src/Text/Pandoc/Writers/OpenDocument.hs+7−5
@@ -489,14 +489,16 @@ paraStyle parent attrs = do
489489 tight = if t then [ ("fo:margin-top" , "0in" )
490490 , ("fo:margin-bottom" , "0in" )]
491491 else []
492− indent = when (i /= 0 || b || t) $
493− selfClosingTag "style:paragraph-properties" $
494− [ ("fo:margin-left" , indentVal)
492+ indent = if (i /= 0 || b)
493+ then [ ("fo:margin-left" , indentVal)
495494 , ("fo:margin-right" , "0in" )
496495 , ("fo:text-indent" , "0in" )
497496 , ("style:auto-text-indent" , "false" )]
498− ++ tight
499− addParaStyle $ inTags True "style:style" (styleAttr ++ attrs) indent
497+ else []
498+ attributes = indent ++ tight
499+ paraProps = when (not $ null attributes) $
500+ selfClosingTag "style:paragraph-properties" attributes
501+ addParaStyle $ inTags True "style:style" (styleAttr ++ attrs) paraProps
500502 return pn
501503
502504paraListStyle :: Int -> State WriterState Int
tests/writer.opendocument+19−19
@@ -741,25 +741,25 @@
741741 <style:style style:name="P18" style:family="paragraph" style:parent-style-name="Preformatted_20_Text">
742742 </style:style>
743743 <style:style style:name="P19" style:family="paragraph" style:parent-style-name="Text_20_body" style:list-style-name="L2">
744− <style:paragraph-properties fo:margin-left="0.0in" fo:margin-right="0in" fo:text-indent="0in" style:auto-text-indent="false" fo:margin-top="0in" fo:margin-bottom="0in" />
744+ <style:paragraph-properties fo:margin-top="0in" fo:margin-bottom="0in" />
745745 </style:style>
746746 <style:style style:name="P20" style:family="paragraph" style:parent-style-name="Text_20_body" style:list-style-name="L3">
747747 </style:style>
748748 <style:style style:name="P21" style:family="paragraph" style:parent-style-name="Text_20_body" style:list-style-name="L4">
749− <style:paragraph-properties fo:margin-left="0.0in" fo:margin-right="0in" fo:text-indent="0in" style:auto-text-indent="false" fo:margin-top="0in" fo:margin-bottom="0in" />
749+ <style:paragraph-properties fo:margin-top="0in" fo:margin-bottom="0in" />
750750 </style:style>
751751 <style:style style:name="P22" style:family="paragraph" style:parent-style-name="Text_20_body" style:list-style-name="L5">
752752 </style:style>
753753 <style:style style:name="P23" style:family="paragraph" style:parent-style-name="Text_20_body" style:list-style-name="L6">
754− <style:paragraph-properties fo:margin-left="0.0in" fo:margin-right="0in" fo:text-indent="0in" style:auto-text-indent="false" fo:margin-top="0in" fo:margin-bottom="0in" />
754+ <style:paragraph-properties fo:margin-top="0in" fo:margin-bottom="0in" />
755755 </style:style>
756756 <style:style style:name="P24" style:family="paragraph" style:parent-style-name="Text_20_body" style:list-style-name="L7">
757757 </style:style>
758758 <style:style style:name="P25" style:family="paragraph" style:parent-style-name="Text_20_body" style:list-style-name="L8">
759− <style:paragraph-properties fo:margin-left="0.0in" fo:margin-right="0in" fo:text-indent="0in" style:auto-text-indent="false" fo:margin-top="0in" fo:margin-bottom="0in" />
759+ <style:paragraph-properties fo:margin-top="0in" fo:margin-bottom="0in" />
760760 </style:style>
761761 <style:style style:name="P26" style:family="paragraph" style:parent-style-name="Text_20_body" style:list-style-name="L9">
762− <style:paragraph-properties fo:margin-left="0.0in" fo:margin-right="0in" fo:text-indent="0in" style:auto-text-indent="false" fo:margin-top="0in" fo:margin-bottom="0in" />
762+ <style:paragraph-properties fo:margin-top="0in" fo:margin-bottom="0in" />
763763 </style:style>
764764 <style:style style:name="P27" style:family="paragraph" style:parent-style-name="Text_20_body" style:list-style-name="L10">
765765 </style:style>
@@ -768,37 +768,37 @@
768768 <style:style style:name="P29" style:family="paragraph" style:parent-style-name="Text_20_body" style:list-style-name="L12">
769769 </style:style>
770770 <style:style style:name="P30" style:family="paragraph" style:parent-style-name="Text_20_body" style:list-style-name="L13">
771− <style:paragraph-properties fo:margin-left="0.0in" fo:margin-right="0in" fo:text-indent="0in" style:auto-text-indent="false" fo:margin-top="0in" fo:margin-bottom="0in" />
771+ <style:paragraph-properties fo:margin-top="0in" fo:margin-bottom="0in" />
772772 </style:style>
773773 <style:style style:name="P31" style:family="paragraph" style:parent-style-name="Text_20_body" style:list-style-name="L14">
774− <style:paragraph-properties fo:margin-left="0.0in" fo:margin-right="0in" fo:text-indent="0in" style:auto-text-indent="false" fo:margin-top="0in" fo:margin-bottom="0in" />
774+ <style:paragraph-properties fo:margin-top="0in" fo:margin-bottom="0in" />
775775 </style:style>
776776 <style:style style:name="P32" style:family="paragraph" style:parent-style-name="Text_20_body" style:list-style-name="L15">
777− <style:paragraph-properties fo:margin-left="0.0in" fo:margin-right="0in" fo:text-indent="0in" style:auto-text-indent="false" fo:margin-top="0in" fo:margin-bottom="0in" />
777+ <style:paragraph-properties fo:margin-top="0in" fo:margin-bottom="0in" />
778778 </style:style>
779779 <style:style style:name="P33" style:family="paragraph" style:parent-style-name="Text_20_body" style:list-style-name="L16">
780− <style:paragraph-properties fo:margin-left="0.0in" fo:margin-right="0in" fo:text-indent="0in" style:auto-text-indent="false" fo:margin-top="0in" fo:margin-bottom="0in" />
780+ <style:paragraph-properties fo:margin-top="0in" fo:margin-bottom="0in" />
781781 </style:style>
782782 <style:style style:name="P34" style:family="paragraph" style:parent-style-name="Text_20_body" style:list-style-name="L17">
783− <style:paragraph-properties fo:margin-left="0.0in" fo:margin-right="0in" fo:text-indent="0in" style:auto-text-indent="false" fo:margin-top="0in" fo:margin-bottom="0in" />
783+ <style:paragraph-properties fo:margin-top="0in" fo:margin-bottom="0in" />
784784 </style:style>
785785 <style:style style:name="P35" style:family="paragraph" style:parent-style-name="Text_20_body" style:list-style-name="L18">
786786 </style:style>
787787 <style:style style:name="P36" style:family="paragraph" style:parent-style-name="Text_20_body" style:list-style-name="L19">
788− <style:paragraph-properties fo:margin-left="0.0in" fo:margin-right="0in" fo:text-indent="0in" style:auto-text-indent="false" fo:margin-top="0in" fo:margin-bottom="0in" />
788+ <style:paragraph-properties fo:margin-top="0in" fo:margin-bottom="0in" />
789789 </style:style>
790790 <style:style style:name="P37" style:family="paragraph" style:parent-style-name="Text_20_body" style:list-style-name="L20">
791791 </style:style>
792792 <style:style style:name="P38" style:family="paragraph" style:parent-style-name="Text_20_body" style:list-style-name="L21">
793793 </style:style>
794794 <style:style style:name="P39" style:family="paragraph" style:parent-style-name="Text_20_body" style:list-style-name="L22">
795− <style:paragraph-properties fo:margin-left="0.0in" fo:margin-right="0in" fo:text-indent="0in" style:auto-text-indent="false" fo:margin-top="0in" fo:margin-bottom="0in" />
795+ <style:paragraph-properties fo:margin-top="0in" fo:margin-bottom="0in" />
796796 </style:style>
797797 <style:style style:name="P40" style:family="paragraph" style:parent-style-name="Text_20_body" style:list-style-name="L23">
798− <style:paragraph-properties fo:margin-left="0.0in" fo:margin-right="0in" fo:text-indent="0in" style:auto-text-indent="false" fo:margin-top="0in" fo:margin-bottom="0in" />
798+ <style:paragraph-properties fo:margin-top="0in" fo:margin-bottom="0in" />
799799 </style:style>
800800 <style:style style:name="P41" style:family="paragraph" style:parent-style-name="Text_20_body" style:list-style-name="L24">
801− <style:paragraph-properties fo:margin-left="0.0in" fo:margin-right="0in" fo:text-indent="0in" style:auto-text-indent="false" fo:margin-top="0in" fo:margin-bottom="0in" />
801+ <style:paragraph-properties fo:margin-top="0in" fo:margin-bottom="0in" />
802802 </style:style>
803803 <style:style style:name="P42" style:family="paragraph" style:parent-style-name="Preformatted_20_Text">
804804 <style:paragraph-properties fo:margin-left="0.5in" fo:margin-right="0in" fo:text-indent="0in" style:auto-text-indent="false" />
@@ -822,18 +822,18 @@
822822 <style:style style:name="P50" style:family="paragraph" style:parent-style-name="Preformatted_20_Text">
823823 </style:style>
824824 <style:style style:name="P51" style:family="paragraph" style:parent-style-name="Text_20_body" style:list-style-name="L26">
825− <style:paragraph-properties fo:margin-left="0.0in" fo:margin-right="0in" fo:text-indent="0in" style:auto-text-indent="false" fo:margin-top="0in" fo:margin-bottom="0in" />
825+ <style:paragraph-properties fo:margin-top="0in" fo:margin-bottom="0in" />
826826 </style:style>
827827 <style:style style:name="P52" style:family="paragraph" style:parent-style-name="Text_20_body" style:list-style-name="L27">
828− <style:paragraph-properties fo:margin-left="0.0in" fo:margin-right="0in" fo:text-indent="0in" style:auto-text-indent="false" fo:margin-top="0in" fo:margin-bottom="0in" />
828+ <style:paragraph-properties fo:margin-top="0in" fo:margin-bottom="0in" />
829829 </style:style>
830830 <style:style style:name="P53" style:family="paragraph" style:parent-style-name="Text_20_body" style:list-style-name="L28">
831− <style:paragraph-properties fo:margin-left="0.0in" fo:margin-right="0in" fo:text-indent="0in" style:auto-text-indent="false" fo:margin-top="0in" fo:margin-bottom="0in" />
831+ <style:paragraph-properties fo:margin-top="0in" fo:margin-bottom="0in" />
832832 </style:style>
833833 <style:style style:name="P54" style:family="paragraph" style:parent-style-name="Preformatted_20_Text">
834834 </style:style>
835835 <style:style style:name="P55" style:family="paragraph" style:parent-style-name="Text_20_body" style:list-style-name="L29">
836− <style:paragraph-properties fo:margin-left="0.0in" fo:margin-right="0in" fo:text-indent="0in" style:auto-text-indent="false" fo:margin-top="0in" fo:margin-bottom="0in" />
836+ <style:paragraph-properties fo:margin-top="0in" fo:margin-bottom="0in" />
837837 </style:style>
838838 <style:style style:name="P56" style:family="paragraph" style:parent-style-name="Quotations">
839839 <style:paragraph-properties fo:margin-left="0.5in" fo:margin-right="0in" fo:text-indent="0in" style:auto-text-indent="false" />
@@ -846,7 +846,7 @@
846846 <style:paragraph-properties fo:margin-left="0.5in" fo:margin-right="0in" fo:text-indent="0in" style:auto-text-indent="false" />
847847 </style:style>
848848 <style:style style:name="P60" style:family="paragraph" style:parent-style-name="Text_20_body" style:list-style-name="L30">
849− <style:paragraph-properties fo:margin-left="0.0in" fo:margin-right="0in" fo:text-indent="0in" style:auto-text-indent="false" fo:margin-top="0in" fo:margin-bottom="0in" />
849+ <style:paragraph-properties fo:margin-top="0in" fo:margin-bottom="0in" />
850850 </style:style>
851851 </office:automatic-styles>
852852<office:body>