diff options
author | Albert Krewinkel <albert@zeitkraut.de> | 2016-10-13 08:46:44 +0200 |
---|---|---|
committer | Albert Krewinkel <albert@zeitkraut.de> | 2016-10-13 08:46:44 +0200 |
commit | 22cb9e3327ff4aea6109c048a185506e67f07ef1 (patch) | |
tree | f3d18ed0fcfa1c0ad273730151dbc80329590da6 /src/Text/Pandoc/Writers/FB2.hs | |
parent | 64b77cc2c5aa9db5432f616f49a660ec9dbbcc9f (diff) |
Add support for the LineBlock element to writers
The following markup features are used to output the lines of the `LineBlock`
element:
- AsciiDoc: a `[verse]` block,
- ConTeXt: text surrounded by `\startlines` and `\endlines`,
- HTML: `div` with an per-element style setting to interpret the content as
pre-wrapped,
- Markdown: line blocks if the `line_blocks` extension is enabled, a simple
paragraph with hard linebreaks otherwise,
- Org: VERSE block,
- RST: a line block, and
- all other formats: a paragraph, containing hard linebreaks between lines.
Custom lua writers should be updated to use the `LineBlock` element.
Diffstat (limited to 'src/Text/Pandoc/Writers/FB2.hs')
-rw-r--r-- | src/Text/Pandoc/Writers/FB2.hs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Writers/FB2.hs b/src/Text/Pandoc/Writers/FB2.hs index 80296e111..6f47dbcd2 100644 --- a/src/Text/Pandoc/Writers/FB2.hs +++ b/src/Text/Pandoc/Writers/FB2.hs @@ -46,7 +46,8 @@ import qualified Text.XML.Light.Cursor as XC import Text.Pandoc.Definition import Text.Pandoc.Options (WriterOptions(..), HTMLMathMethod(..), def) -import Text.Pandoc.Shared (orderedListMarkers, isHeaderBlock, capitalize) +import Text.Pandoc.Shared (orderedListMarkers, isHeaderBlock, capitalize, + linesToPara) -- | Data to be written at the end of the document: -- (foot)notes, URLs, references, images. @@ -323,6 +324,7 @@ blockToXml (RawBlock _ s) = return . spaceBeforeAfter . map (el "p" . el "code") . lines $ s blockToXml (Div _ bs) = cMapM blockToXml bs blockToXml (BlockQuote bs) = liftM (list . el "cite") $ cMapM blockToXml bs +blockToXml (LineBlock lns) = blockToXml $ linesToPara lns blockToXml (OrderedList a bss) = do state <- get let pmrk = parentListMarker state |