git.iko.soy/typeable/pandoc
on master help sign in
Merge branch 'master' into citeproc
f64983fJohn MacFarlane
src/Text/Pandoc/Writers/OpenDocument.hs+4−2
@@ -112,7 +112,9 @@ setInDefinitionList :: Bool -> State WriterState ()
112setInDefinitionList b = modify $ \s -> s { stInDefinition = b }
112setInDefinitionList b = modify $ \s -> s { stInDefinition = b }
113
113
114inParagraphTags :: Doc -> Doc
114inParagraphTags :: Doc -> Doc
115+inParagraphTags d | isEmpty d = empty
116+inParagraphTags d =
115−inParagraphTags = inTags False "text:p" [("text:style-name", "Text_20_body")]
117+ inTags False "text:p" [("text:style-name", "Text_20_body")] d
116
118
117inParagraphTagsWithStyle :: String -> Doc -> Doc
119inParagraphTagsWithStyle :: String -> Doc -> Doc
118inParagraphTagsWithStyle sty = inTags False "text:p" [("text:style-name", sty)]
120inParagraphTagsWithStyle sty = inTags False "text:p" [("text:style-name", sty)]
@@ -359,7 +361,7 @@ inlineToOpenDocument o ils
359 | Code s <- ils = preformatted s
361 | Code s <- ils = preformatted s
360 | Math _ s <- ils = inlinesToOpenDocument o (readTeXMath s)
362 | Math _ s <- ils = inlinesToOpenDocument o (readTeXMath s)
361 | Cite _ l <- ils = inlinesToOpenDocument o l
363 | Cite _ l <- ils = inlinesToOpenDocument o l
362− | TeX s <- ils = preformatted s
364+ | TeX _ <- ils = return empty
363 | HtmlInline s <- ils = preformatted s
365 | HtmlInline s <- ils = preformatted s
364 | Link l (s,t) <- ils = mkLink s t <$> inlinesToOpenDocument o l
366 | Link l (s,t) <- ils = mkLink s t <$> inlinesToOpenDocument o l
365 | Image _ (s,_) <- ils = return $ mkImg s
367 | Image _ (s,_) <- ils = return $ mkImg s
tests/writer.opendocument+1−6
@@ -1301,7 +1301,7 @@
1301<text:h text:style-name="Heading_20_1" text:outline-level="1">LaTeX</text:h>
1301<text:h text:style-name="Heading_20_1" text:outline-level="1">LaTeX</text:h>
1302<text:list text:style-name="L26">
1302<text:list text:style-name="L26">
1303 <text:list-item>
1303 <text:list-item>
1304− <text:p text:style-name="P51"><text:span text:style-name="Teletype">\cite[22-23]{smith.1899}</text:span></text:p>
1304+ <text:p text:style-name="P51"></text:p>
1305 </text:list-item>
1305 </text:list-item>
1306 <text:list-item>
1306 <text:list-item>
1307 <text:p text:style-name="P51">2 + 2 = 4</text:p>
1307 <text:p text:style-name="P51">2 + 2 = 4</text:p>
@@ -1341,11 +1341,6 @@
1341 </text:list-item>
1341 </text:list-item>
1342</text:list>
1342</text:list>
1343<text:p text:style-name="Text_20_body">Here&#8217;s a LaTeX table:</text:p>
1343<text:p text:style-name="Text_20_body">Here&#8217;s a LaTeX table:</text:p>
1344−<text:p text:style-name="Text_20_body"><text:span text:style-name="Teletype">\begin{tabular}{|l|l|}\hline
1345−Animal &amp; Number \\ \hline
1346−Dog <text:s text:c="3" />&amp; 2 <text:s text:c="5" />\\
1347−Cat <text:s text:c="3" />&amp; 1 <text:s text:c="5" />\\ \hline
1348−\end{tabular}</text:span></text:p>
1349<text:p text:style-name="Horizontal_20_Line" />
1344<text:p text:style-name="Horizontal_20_Line" />
1350<text:h text:style-name="Heading_20_1" text:outline-level="1">Special Characters</text:h>
1345<text:h text:style-name="Heading_20_1" text:outline-level="1">Special Characters</text:h>
1351<text:p text:style-name="Text_20_body">Here is some unicode:</text:p>
1346<text:p text:style-name="Text_20_body">Here is some unicode:</text:p>