diff options
author | John MacFarlane <jgm@berkeley.edu> | 2011-02-04 18:32:54 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2011-02-04 18:32:54 -0800 |
commit | 221177c272cbe21513b3f012959a10530ece720d (patch) | |
tree | 027c0b1bd055def426ca44d033a7b4168b09ad0e /src | |
parent | 714303b210b249292b83eb13ed37dd897999380d (diff) | |
download | pandoc-221177c272cbe21513b3f012959a10530ece720d.tar.gz |
Shared: Minor refactoring.
Diffstat (limited to 'src')
-rw-r--r-- | src/Text/Pandoc/Shared.hs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Shared.hs b/src/Text/Pandoc/Shared.hs index 37873f822..8326c89ae 100644 --- a/src/Text/Pandoc/Shared.hs +++ b/src/Text/Pandoc/Shared.hs @@ -287,7 +287,10 @@ removeEmptyInlines (x : xs) = x : removeEmptyInlines xs removeEmptyInlines [] = [] removeTrailingInlineSpaces :: [Inline] -> [Inline] -removeTrailingInlineSpaces = reverse . dropWhile isSpaceOrEmpty . reverse +removeTrailingInlineSpaces = reverse . removeLeadingInlineSpaces . reverse + +removeLeadingInlineSpaces :: [Inline] -> [Inline] +removeLeadingInlineSpaces = dropWhile isSpaceOrEmpty consolidateInlines :: [Inline] -> [Inline] consolidateInlines (Str x : ys) = |