@@ -108,7 +108,7 @@ plainToPara :: Block -> Block
108plainToPara (Plain x) = Para x
108plainToPara (Plain x) = Para x
109plainToPara x = x
109plainToPara x = x
111−-- | Convert a list of pairs of terms and definitions into a TEI
111+-- | Convert a list of pairs of terms and definitions into a TEI
112-- list with labels and items.
112-- list with labels and items.
113deflistItemsToTEI :: WriterOptions -> [([Inline],[[Block]])] -> Doc
113deflistItemsToTEI :: WriterOptions -> [([Inline],[[Block]])] -> Doc
114deflistItemsToTEI opts items =
114deflistItemsToTEI opts items =
@@ -167,6 +167,8 @@ blockToTEI opts (Plain lst) = blockToTEI opts $ Para lst
167-- inTagsSimple "textobject" (inTagsSimple "phrase" alt))
167-- inTagsSimple "textobject" (inTagsSimple "phrase" alt))
168blockToTEI opts (Para lst) =
168blockToTEI opts (Para lst) =
169 inTags False "p" [] $ inlinesToTEI opts lst
169 inTags False "p" [] $ inlinesToTEI opts lst
170+blockToTEI opts (LineBlock lns) =
171+ blockToTEI opts $ linesToPara lns
170blockToTEI opts (BlockQuote blocks) =
172blockToTEI opts (BlockQuote blocks) =
171 inTagsIndented "quote" $ blocksToTEI opts blocks
173 inTagsIndented "quote" $ blocksToTEI opts blocks
172blockToTEI _ (CodeBlock (_,classes,_) str) =
174blockToTEI _ (CodeBlock (_,classes,_) str) =
@@ -174,7 +176,7 @@ blockToTEI _ (CodeBlock (_,classes,_) str) =
174 flush (text (escapeStringForXML str) <> cr <> text "</ab>")
176 flush (text (escapeStringForXML str) <> cr <> text "</ab>")
175 where lang = if null langs
177 where lang = if null langs
177− else escapeStringForXML (head langs)
179+ else escapeStringForXML (head langs)
178 isLang l = map toLower l `elem` map (map toLower) languages
180 isLang l = map toLower l `elem` map (map toLower) languages
179 langsFrom s = if isLang s
181 langsFrom s = if isLang s
@@ -210,7 +212,7 @@ blockToTEI _ HorizontalRule =
210 selfClosingTag "milestone" [("unit","undefined"), ("type","separator"),("rendition","line")]
212 selfClosingTag "milestone" [("unit","undefined"), ("type","separator"),("rendition","line")]
212-- | TEI Tables
214-- | TEI Tables
213−-- TEI Simple's tables are composed of cells and rows; other
215+-- TEI Simple's tables are composed of cells and rows; other
214-- table info in the AST is here lossily discard.
216-- table info in the AST is here lossily discard.
215blockToTEI opts (Table _ _ _ headers rows) =
217blockToTEI opts (Table _ _ _ headers rows) =
@@ -219,8 +221,8 @@ blockToTEI opts (Table _ _ _ headers rows) =
219-- then return empty
221-- then return empty
220-- else tableRowToTEI opts headers
222-- else tableRowToTEI opts headers
222− inTags True "table" [] $
224+ inTags True "table" [] $
223− vcat $ [headers'] <> map (tableRowToTEI opts) rows
225+ vcat $ [headers'] <> map (tableRowToTEI opts) rows
225tableRowToTEI :: WriterOptions
227tableRowToTEI :: WriterOptions
226 -> [[Block]]
228 -> [[Block]]
@@ -276,7 +278,7 @@ inlineToTEI _ (Math t str) =
276 text (str)
278 text (str)
277 DisplayMath -> inTags True "figure" [("type","math")] $
279 DisplayMath -> inTags True "figure" [("type","math")] $
278 inTags False "formula" [("notation","TeX")] $ text (str)
280 inTags False "formula" [("notation","TeX")] $ text (str)
280inlineToTEI _ (RawInline f x) | f == "tei" = text x
282inlineToTEI _ (RawInline f x) | f == "tei" = text x
281 | otherwise = empty
283 | otherwise = empty
282inlineToTEI _ LineBreak = selfClosingTag "lb" []
284inlineToTEI _ LineBreak = selfClosingTag "lb" []
@@ -317,4 +319,3 @@ idAndRole (id',cls,_) = ident ++ role
317 role = if null cls
319 role = if null cls
319 else [("role", unwords cls)]
321 else [("role", unwords cls)]