summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2012-08-13 15:52:41 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2012-08-13 15:52:41 -0700
commit76edb6b848520ac3733b891cffdc92c0d350d371 (patch)
tree85f3ccf34a1ffc3bf576f54d00806eac5c30e1b0
parent27304513f660cc158d73ec5684a01491fa1fed99 (diff)
Pretty: Fixed bug that caused combining characters to be dropped.
-rw-r--r--src/Text/Pandoc/Pretty.hs11
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