diff options
author | John MacFarlane <jgm@berkeley.edu> | 2012-08-13 15:52:41 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2012-08-13 15:52:41 -0700 |
commit | 76edb6b848520ac3733b891cffdc92c0d350d371 (patch) | |
tree | 85f3ccf34a1ffc3bf576f54d00806eac5c30e1b0 | |
parent | 27304513f660cc158d73ec5684a01491fa1fed99 (diff) | |
download | pandoc-76edb6b848520ac3733b891cffdc92c0d350d371.tar.gz |
Pretty: Fixed bug that caused combining characters to be dropped.
-rw-r--r-- | src/Text/Pandoc/Pretty.hs | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/Text/Pandoc/Pretty.hs b/src/Text/Pandoc/Pretty.hs index 6cb6bce18..211fdf20e 100644 --- a/src/Text/Pandoc/Pretty.hs +++ b/src/Text/Pandoc/Pretty.hs @@ -202,18 +202,17 @@ chomp d = Doc (fromList dl') outp :: (IsString a, Monoid a) => Int -> String -> DocState a -outp off s | off <= 0 = do +outp off s | off < 0 = do -- offset < 0 means newline characters st' <- get let rawpref = prefix st' when (column st' == 0 && usePrefix st' && not (null rawpref)) $ do let pref = reverse $ dropWhile isSpace $ reverse rawpref modify $ \st -> st{ output = fromString pref : output st , column = column st + realLength pref } - when (off < 0) $ do - modify $ \st -> st { output = fromString s : output st - , column = 0 - , newlines = newlines st + 1 } -outp off s = do + modify $ \st -> st { output = fromString s : output st + , column = 0 + , newlines = newlines st + 1 } +outp off s = do -- offset >= 0 (0 might be combining char) st' <- get let pref = prefix st' when (column st' == 0 && usePrefix st' && not (null pref)) $ do |