aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers/Ms.hs
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2021-10-02 22:56:55 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2021-10-11 09:45:22 -0700
commit5d17020a20543a5c4864ecb81b0caa5b64c280a9 (patch)
tree8306c9cd294c643158362b6f2a98ce8350261f1f /src/Text/Pandoc/Writers/Ms.hs
parent2befeaa29f9589f81a3d6cd394d88f29089e7338 (diff)
downloadpandoc-5d17020a20543a5c4864ecb81b0caa5b64c280a9.tar.gz
T.P.Writers.Shared: Export splitSentences as a Doc Text transform.
[API change] Use this in man/ms.
Diffstat (limited to 'src/Text/Pandoc/Writers/Ms.hs')
-rw-r--r--src/Text/Pandoc/Writers/Ms.hs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/Text/Pandoc/Writers/Ms.hs b/src/Text/Pandoc/Writers/Ms.hs
index 719407ac1..332368a67 100644
--- a/src/Text/Pandoc/Writers/Ms.hs
+++ b/src/Text/Pandoc/Writers/Ms.hs
@@ -142,7 +142,7 @@ blockToMs opts (Div (ident,cls,kvs) bs) = do
setFirstPara
return $ anchor $$ res
blockToMs opts (Plain inlines) =
- inlineListToMs' opts inlines
+ splitSentences <$> inlineListToMs' opts inlines
blockToMs opts (Para [Image attr alt (src,_tit)])
| let ext = takeExtension (T.unpack src) in (ext == ".ps" || ext == ".eps") = do
let (mbW,mbH) = (inPoints opts <$> dimension Width attr,
@@ -155,7 +155,7 @@ blockToMs opts (Para [Image attr alt (src,_tit)])
space <>
doubleQuotes (literal (tshow (floor hp :: Int)))
_ -> empty
- capt <- inlineListToMs' opts alt
+ capt <- splitSentences <$> inlineListToMs' opts alt
return $ nowrap (literal ".PSPIC -C " <>
doubleQuotes (literal (escapeStr opts src)) <>
sizeAttrs) $$
@@ -166,7 +166,8 @@ blockToMs opts (Para inlines) = do
firstPara <- gets stFirstPara
resetFirstPara
contents <- inlineListToMs' opts inlines
- return $ literal (if firstPara then ".LP" else ".PP") $$ contents
+ return $ literal (if firstPara then ".LP" else ".PP") $$
+ splitSentences contents
blockToMs _ b@(RawBlock f str)
| f == Format "ms" = return $ literal str
| otherwise = do