git.iko.soy/typeable/pandoc
on master help sign in
OpenDocument writer: don't print raw TeX.
commite9cfbd5adc7a2f19be24904b6fb4d200ddbaa9ce authorJohn MacFarlane <jgm@berkeley.edu> dateSat 27 Nov 2010, 14:57 (16 years ago) parent970f63c
2 files changed+5−8
src/Text/Pandoc/Writers/OpenDocument.hs+4−2 tests/writer.opendocument+1−6
src/Text/Pandoc/Writers/OpenDocument.hs+4−2
@@ -112,7 +112,9 @@ setInDefinitionList :: Bool -> State WriterState ()
112112setInDefinitionList b = modify $ \s -> s { stInDefinition = b }
113113
114114inParagraphTags :: Doc -> Doc
115−inParagraphTags = inTags False "text:p" [("text:style-name", "Text_20_body")]
115+inParagraphTags d | isEmpty d = empty
116+inParagraphTags d =
117+ inTags False "text:p" [("text:style-name", "Text_20_body")] d
116118
117119inParagraphTagsWithStyle :: String -> Doc -> Doc
118120inParagraphTagsWithStyle sty = inTags False "text:p" [("text:style-name", sty)]
@@ -359,7 +361,7 @@ inlineToOpenDocument o ils
359361 | Code s <- ils = preformatted s
360362 | Math _ s <- ils = inlinesToOpenDocument o (readTeXMath s)
361363 | Cite _ l <- ils = inlinesToOpenDocument o l
362− | TeX s <- ils = preformatted s
364+ | TeX _ <- ils = return empty
363365 | HtmlInline s <- ils = preformatted s
364366 | Link l (s,t) <- ils = mkLink s t <$> inlinesToOpenDocument o l
365367 | Image _ (s,_) <- ils = return $ mkImg s
tests/writer.opendocument+1−6
@@ -1301,7 +1301,7 @@
13011301<text:h text:style-name="Heading_20_1" text:outline-level="1">LaTeX</text:h>
13021302<text:list text:style-name="L26">
13031303 <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>
13051305 </text:list-item>
13061306 <text:list-item>
13071307 <text:p text:style-name="P51">2 + 2 = 4</text:p>
@@ -1341,11 +1341,6 @@
13411341 </text:list-item>
13421342</text:list>
13431343<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>
13491344<text:p text:style-name="Horizontal_20_Line" />
13501345<text:h text:style-name="Heading_20_1" text:outline-level="1">Special Characters</text:h>
13511346<text:p text:style-name="Text_20_body">Here is some unicode:</text:p>