summaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Shared.hs
diff options
context:
space:
mode:
authorhftf <hftf@users.noreply.github.com>2017-10-27 18:45:00 -0400
committerJohn MacFarlane <jgm@berkeley.edu>2017-10-27 18:45:00 -0400
commit7f8a3c6cb70e61666598873dbcea8ef45ab85b56 (patch)
tree74d187a1f0f57733ecd76b331f4259e1469204e2 /src/Text/Pandoc/Shared.hs
parent2ddf08641d5e27046ae97ebd3cb4602025016ed5 (diff)
Consistent underline for Readers (#2270)
* Added underlineSpan builder function. This can be easily updated if needed. The purpose is for Readers to transform underlines consistently. * Docx Reader: Use underlineSpan and update test * Org Reader: Use underlineSpan and add test * Textile Reader: Use underlineSpan and add test case * Txt2Tags Reader: Use underlineSpan and update test * HTML Reader: Use underlineSpan and add test case
Diffstat (limited to 'src/Text/Pandoc/Shared.hs')
-rw-r--r--src/Text/Pandoc/Shared.hs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Shared.hs b/src/Text/Pandoc/Shared.hs
index 4c5f464d8..2307470a1 100644
--- a/src/Text/Pandoc/Shared.hs
+++ b/src/Text/Pandoc/Shared.hs
@@ -72,6 +72,7 @@ module Text.Pandoc.Shared (
addMetaField,
makeMeta,
eastAsianLineBreakFilter,
+ underlineSpan,
-- * TagSoup HTML handling
renderTags',
-- * File handling
@@ -563,6 +564,13 @@ eastAsianLineBreakFilter = bottomUp go
_ -> x:SoftBreak:y:zs
go xs = xs
+-- | Builder for underline.
+-- This probably belongs in Builder.hs in pandoc-types.
+-- Will be replaced once Underline is an element.
+underlineSpan :: Inlines -> Inlines
+underlineSpan = B.spanWith ("", ["underline"], [])
+
+
--
-- TagSoup HTML handling
--