parent
54d16545c9
commit
b6305a63cd
2 changed files with 7 additions and 2 deletions
|
@ -119,7 +119,7 @@ description meta' = do
|
|||
let as = authors meta'
|
||||
dd <- docdate meta'
|
||||
annotation <- case lookupMeta "abstract" meta' of
|
||||
Just (MetaBlocks bs) -> (list . el "annotation") <$> cMapM blockToXml bs
|
||||
Just (MetaBlocks bs) -> (list . el "annotation") <$> (cMapM blockToXml $ map unPlain bs)
|
||||
_ -> pure mempty
|
||||
let lang = case lookupMeta "lang" meta' of
|
||||
Just (MetaInlines [Str s]) -> [el "lang" $ iso639 s]
|
||||
|
@ -398,6 +398,11 @@ plainToPara (Para inlines : rest) =
|
|||
Para inlines : HorizontalRule : plainToPara rest -- HorizontalRule will be converted to <empty-line />
|
||||
plainToPara (p:rest) = p : plainToPara rest
|
||||
|
||||
-- Replace plain text with paragraphs
|
||||
unPlain :: Block -> Block
|
||||
unPlain (Plain inlines) = Para inlines
|
||||
unPlain x = x
|
||||
|
||||
-- Simulate increased indentation level. Will not really work
|
||||
-- for multi-line paragraphs.
|
||||
indentPrefix :: String -> Block -> Block
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<FictionBook xmlns="http://www.gribuser.ru/xml/fictionbook/2.0" xmlns:l="http://www.w3.org/1999/xlink"><description><title-info><genre>unrecognised</genre><book-title>Book title</book-title><annotation><p>This is the abstract.</p>It consists of two paragraphs.</annotation></title-info><document-info><program-used>pandoc</program-used></document-info></description><body><title><p>Book title</p></title></body></FictionBook>
|
||||
<FictionBook xmlns="http://www.gribuser.ru/xml/fictionbook/2.0" xmlns:l="http://www.w3.org/1999/xlink"><description><title-info><genre>unrecognised</genre><book-title>Book title</book-title><annotation><p>This is the abstract.</p><p>It consists of two paragraphs.</p></annotation></title-info><document-info><program-used>pandoc</program-used></document-info></description><body><title><p>Book title</p></title></body></FictionBook>
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue