diff options
author | John MacFarlane <jgm@berkeley.edu> | 2014-08-11 14:44:08 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2014-08-11 14:44:08 -0700 |
commit | 31811657fa3d097b6399ae8ec83c180ed4f38afe (patch) | |
tree | 8db00c943b2c0e3a2d377af7bbccde29f36483a6 /src/Text/Pandoc/Readers/Docx | |
parent | 211fe266e064ef894153a3d711cea427595ab966 (diff) | |
parent | 241ef57bb24f5eb972d6195a137a74d4b19b2f1f (diff) | |
download | pandoc-31811657fa3d097b6399ae8ec83c180ed4f38afe.tar.gz |
Merge pull request #1521 from jkr/emptyEmph
Discard empty formatters
Diffstat (limited to 'src/Text/Pandoc/Readers/Docx')
-rw-r--r-- | src/Text/Pandoc/Readers/Docx/Reducible.hs | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/Text/Pandoc/Readers/Docx/Reducible.hs b/src/Text/Pandoc/Readers/Docx/Reducible.hs index 2dbef4131..a852e25bf 100644 --- a/src/Text/Pandoc/Readers/Docx/Reducible.hs +++ b/src/Text/Pandoc/Readers/Docx/Reducible.hs @@ -88,11 +88,13 @@ combineReducibles r s = in case null shared of True | (x : xs) <- reverse rs - , isSpace x -> - rebuild conts (reverse xs) ++ [x, s] + , isSpace x -> case xs of + [] -> [x, s] + _ -> rebuild conts (reverse xs) ++ [x, s] | (x : xs) <- ss - , isSpace x -> - [r, x] ++ rebuild conts' (xs) + , isSpace x -> case xs of + [] -> [r, x] + _ -> [r, x] ++ rebuild conts' (xs) True -> [r,s] False -> rebuild shared $ @@ -121,7 +123,6 @@ instance Reducible Inline where False -> [Span attr2' ils2] in [Span attr' $ reduceList $ s1' ++ s2'] - (Str x) <++> (Str y) = [Str (x++y)] il <++> il' = combineReducibles il il' |