diff options
author | John MacFarlane <fiddlosopher@gmail.com> | 2012-10-29 22:45:52 -0700 |
---|---|---|
committer | John MacFarlane <fiddlosopher@gmail.com> | 2013-01-09 09:30:05 -0800 |
commit | d599c4cdabd0d71fd9d27161c949b5e1e692436d (patch) | |
tree | 96b6130be929282f85d0261bbb0e0ef37e4e43ff /src/Text/Pandoc/Writers/RTF.hs | |
parent | 7a40fa8c08996cb94e7ff3cfafd8ede84972ce70 (diff) | |
download | pandoc-d599c4cdabd0d71fd9d27161c949b5e1e692436d.tar.gz |
Added Attr field to Header.
Previously header ids were autogenerated by the writers.
Now they are generated (unless supplied explicitly) in the
markdown parser, if the `header_identifiers` extension is
selected.
In addition, the textile reader now supports id attributes on
headers.
Diffstat (limited to 'src/Text/Pandoc/Writers/RTF.hs')
-rw-r--r-- | src/Text/Pandoc/Writers/RTF.hs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Text/Pandoc/Writers/RTF.hs b/src/Text/Pandoc/Writers/RTF.hs index 619e7086f..f2a271c1d 100644 --- a/src/Text/Pandoc/Writers/RTF.hs +++ b/src/Text/Pandoc/Writers/RTF.hs @@ -72,7 +72,7 @@ writeRTF options (Pandoc (Meta title authors date) blocks) = datetext = inlineListToRTF date spacer = not $ all null $ titletext : datetext : authorstext body = concatMap (blockToRTF 0 AlignDefault) blocks - isTOCHeader (Header lev _) = lev <= writerTOCDepth options + isTOCHeader (Header lev _ _) = lev <= writerTOCDepth options isTOCHeader _ = False context = writerVariables options ++ [ ("body", body) @@ -91,7 +91,7 @@ tableOfContents :: [Block] -> String tableOfContents headers = let contentsTree = hierarchicalize headers in concatMap (blockToRTF 0 AlignDefault) $ - [Header 1 [Str "Contents"], + [Header 1 nullAttr [Str "Contents"], BulletList (map elementToListItem contentsTree)] elementToListItem :: Element -> [Block] @@ -208,7 +208,7 @@ blockToRTF indent alignment (DefinitionList lst) = spaceAtEnd $ concatMap (definitionListItemToRTF alignment indent) lst blockToRTF indent _ HorizontalRule = rtfPar indent 0 AlignCenter "\\emdash\\emdash\\emdash\\emdash\\emdash" -blockToRTF indent alignment (Header level lst) = rtfPar indent 0 alignment $ +blockToRTF indent alignment (Header level _ lst) = rtfPar indent 0 alignment $ "\\b \\fs" ++ (show (40 - (level * 4))) ++ " " ++ inlineListToRTF lst blockToRTF indent alignment (Table caption aligns sizes headers rows) = (if all null headers |