@@ -1059,13 +1059,24 @@ withParaPropM :: PandocMonad m => WS m Element -> WS m a -> WS m a
1059withParaPropM = (. flip withParaProp) . (>>=)
1059withParaPropM = (. flip withParaProp) . (>>=)
1061formattedString :: PandocMonad m => String -> WS m [Element]
1061formattedString :: PandocMonad m => String -> WS m [Element]
1062−formattedString str = do
1062+formattedString str =
1063− props <- getTextProps
1063+ -- properly handle soft hyphens
1064+ case splitBy (=='\173') str of
1065+ [w] -> formattedString' w
1067+ sh <- formattedRun [mknode "w:softHyphen" [] ()]
1068+ (intercalate sh) <$> mapM formattedString' ws
1070+formattedString' :: PandocMonad m => String -> WS m [Element]
1071+formattedString' str = do
1064 inDel <- asks envInDel
1072 inDel <- asks envInDel
1065− return [ mknode "w:r" [] $
1067− [ mknode (if inDel then "w:delText" else "w:t")
1073+ formattedRun [ mknode (if inDel then "w:delText" else "w:t")
1068− [("xml:space","preserve")] (stripInvalidChars str) ] ]
1074+ [("xml:space","preserve")] (stripInvalidChars str) ]
1076+formattedRun :: PandocMonad m => [Element] -> WS m [Element]
1077+formattedRun els = do
1078+ props <- getTextProps
1079+ return [ mknode "w:r" [] $ props ++ els ]
1070setFirstPara :: PandocMonad m => WS m ()
1081setFirstPara :: PandocMonad m => WS m ()
1071setFirstPara = modify $ \s -> s { stFirstPara = True }
1082setFirstPara = modify $ \s -> s { stFirstPara = True }
@@ -1075,7 +1086,8 @@ inlineToOpenXML :: PandocMonad m => WriterOptions -> Inline -> WS m [Element]
1075inlineToOpenXML opts il = withDirection $ inlineToOpenXML' opts il
1086inlineToOpenXML opts il = withDirection $ inlineToOpenXML' opts il
1077inlineToOpenXML' :: PandocMonad m => WriterOptions -> Inline -> WS m [Element]
1088inlineToOpenXML' :: PandocMonad m => WriterOptions -> Inline -> WS m [Element]
1078−inlineToOpenXML' _ (Str str) = formattedString str
1089+inlineToOpenXML' _ (Str str) =
1090+ formattedString str
1079inlineToOpenXML' opts Space = inlineToOpenXML opts (Str " ")
1091inlineToOpenXML' opts Space = inlineToOpenXML opts (Str " ")
1080inlineToOpenXML' opts SoftBreak = inlineToOpenXML opts (Str " ")
1092inlineToOpenXML' opts SoftBreak = inlineToOpenXML opts (Str " ")
1081inlineToOpenXML' opts (Span (ident,classes,kvs) ils) = do
1093inlineToOpenXML' opts (Span (ident,classes,kvs) ils) = do