diff options
author | John MacFarlane <jgm@berkeley.edu> | 2017-03-10 20:44:49 +0100 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2017-03-10 20:45:21 +0100 |
commit | ba78b75146d9d02de64b400a78402aac884f0644 (patch) | |
tree | c2070c52e429b4ca97c29e2a9231025c88c47129 /src/Text/Pandoc/Shared.hs | |
parent | a197dc9d3fa578d223ab07884906351cced646c9 (diff) |
Removed normalizeSpaces from Text.Pandoc.Shared.
Rewrote functions in RST reader and writer to avoid the need
for it.
Closes #1530.
Diffstat (limited to 'src/Text/Pandoc/Shared.hs')
-rw-r--r-- | src/Text/Pandoc/Shared.hs | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/src/Text/Pandoc/Shared.hs b/src/Text/Pandoc/Shared.hs index 2eacbcc1c..3b9ae7501 100644 --- a/src/Text/Pandoc/Shared.hs +++ b/src/Text/Pandoc/Shared.hs @@ -53,7 +53,6 @@ module Text.Pandoc.Shared ( normalizeDate, -- * Pandoc block and inline list processing orderedListMarkers, - normalizeSpaces, extractSpaces, removeFormatting, deNote, @@ -354,25 +353,6 @@ orderedListMarkers (start, numstyle, numdelim) = TwoParens -> "(" ++ str ++ ")" in map inDelim nums --- | Normalize a list of inline elements: remove leading and trailing --- @Space@, @LineBreak@, and @SoftBreak@ elements, collapse double --- @Space@s into singles, and remove empty @Str@ elements. -normalizeSpaces :: [Inline] -> [Inline] -normalizeSpaces = cleanup . dropWhile isSpaceOrEmpty - where cleanup [] = [] - cleanup (Space:rest) = case dropWhile isSpaceOrEmpty rest of - [] -> [] - (x:xs) -> Space : x : cleanup xs - cleanup ((Str ""):rest) = cleanup rest - cleanup (x:rest) = x : cleanup rest - -isSpaceOrEmpty :: Inline -> Bool -isSpaceOrEmpty Space = True -isSpaceOrEmpty SoftBreak = True -isSpaceOrEmpty LineBreak = True -isSpaceOrEmpty (Str "") = True -isSpaceOrEmpty _ = False - -- | Extract the leading and trailing spaces from inside an inline element -- and place them outside the element. SoftBreaks count as Spaces for -- these purposes. |