aboutsummaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2016-01-08 17:33:37 -0800
committercsforste <cforster@syr.edu>2016-01-19 14:03:57 -0500
commit4d74a966c4dae72f627696e6440f8ac530965d6c (patch)
tree865698c9e9aaea4074e77dc70e7de48d202c43ee /src/Text
parent25a9ca697a9fa3354e7a634d386efdef4031776f (diff)
downloadpandoc-4d74a966c4dae72f627696e6440f8ac530965d6c.tar.gz
Added some entity tests in Markdown reader tests.
Change types of divs. From Docbook "sect#" and "simplesect" to "level#" and "section." Add tests. Add mention of TEI to README. Small changes to TEI writer.
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Writers/TEI.hs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/Text/Pandoc/Writers/TEI.hs b/src/Text/Pandoc/Writers/TEI.hs
index be9390de4..b9e683ab9 100644
--- a/src/Text/Pandoc/Writers/TEI.hs
+++ b/src/Text/Pandoc/Writers/TEI.hs
@@ -92,8 +92,8 @@ elementToTEI opts lvl (Sec _ _num (id',_,_) title elements) =
else elements
divType = case lvl of
n | n == 0 -> "chapter"
- | n >= 1 && n <= 5 -> "sect" ++ show n
- | otherwise -> "simplesect"
+ | n >= 1 && n <= 5 -> "level" ++ show n
+ | otherwise -> "section"
in inTags True "div" [("type", divType) | not (null id')] $
-- ("id", writerIdentifierPrefix opts ++ id') | not (null id')] $
inTagsSimple "head" (inlinesToTEI opts title) $$
@@ -181,7 +181,7 @@ blockToTEI _ (CodeBlock (_,classes,_) str) =
else languagesByExtension . map toLower $ s
langs = concatMap langsFrom classes
blockToTEI opts (BulletList lst) =
- let attribs = [("type", "bullet") | isTightList lst]
+ let attribs = [("type", "unordered")]
in inTags True "list" attribs $ listItemsToTEI opts lst
blockToTEI _ (OrderedList _ []) = empty
blockToTEI opts (OrderedList (start, numstyle, _) (first:rest)) =
@@ -277,9 +277,9 @@ inlineToTEI _ (Math t str) =
DisplayMath -> inTags True "figure" [("type","math")] $
inTags False "formula" [("notation","TeX")] $ text (str)
-inlineToTEI _ (RawInline f x) | f == "html" || f == "tei" = text x
- | otherwise = empty
-inlineToTEI _ LineBreak = text ""
+inlineToTEI _ (RawInline f x) | f == "tei" = text x
+ | otherwise = empty
+inlineToTEI _ LineBreak = selfClosingTag "lb" []
inlineToTEI _ Space = space
-- because we use \n for LineBreak, we can't do soft breaks:
inlineToTEI _ SoftBreak = space