diff options
author | Hubert Plociniczak <hubert.plociniczak@gmail.com> | 2016-10-26 15:53:33 +0200 |
---|---|---|
committer | Jesse Rosenthal <jrosenthal@jhu.edu> | 2016-11-08 09:29:46 -0500 |
commit | 13bc573e7f9e0602404dd37fec2c7cd14b5c56ee (patch) | |
tree | a00a7be544b104df4544ddfcd5301300476b78cc /src/Text/Pandoc/Writers | |
parent | eced02d70e0a4e8d7dfa4c373a6c4d8a4cc08407 (diff) | |
download | pandoc-13bc573e7f9e0602404dd37fec2c7cd14b5c56ee.tar.gz |
Inline code when text has a special style
When a piece of text has a text 'Source_Text' then
we assume that this is a piece of the document
that represents a code that needs to be inlined.
Addapted an odt writer to also reflect that change;
previously it was just writing a 'preformatted' text using
a non-distinguishable font style.
Code blocks are still not recognized by the ODT reader.
That's a separate issue.
Diffstat (limited to 'src/Text/Pandoc/Writers')
-rw-r--r-- | src/Text/Pandoc/Writers/OpenDocument.hs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Writers/OpenDocument.hs b/src/Text/Pandoc/Writers/OpenDocument.hs index 583aa2e4a..42c151780 100644 --- a/src/Text/Pandoc/Writers/OpenDocument.hs +++ b/src/Text/Pandoc/Writers/OpenDocument.hs @@ -392,7 +392,7 @@ inlineToOpenDocument o ils Subscript l -> withTextStyle Sub $ inlinesToOpenDocument o l SmallCaps l -> withTextStyle SmallC $ inlinesToOpenDocument o l Quoted t l -> inQuotes t <$> inlinesToOpenDocument o l - Code _ s -> withTextStyle Pre $ inTextStyle $ preformatted s + Code _ s -> inlinedCode $ preformatted s Math t s -> inlinesToOpenDocument o (texMathToInlines t s) Cite _ l -> inlinesToOpenDocument o l RawInline f s -> if f == Format "opendocument" @@ -403,6 +403,7 @@ inlineToOpenDocument o ils Note l -> mkNote l where preformatted s = handleSpaces $ escapeStringForXML s + inlinedCode s = return $ inTags False "text:span" [("text:style-name", "Source_Text")] s mkLink s t = inTags False "text:a" [ ("xlink:type" , "simple") , ("xlink:href" , s ) , ("office:name", t ) |