aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn MacFarlane <[email protected]>2025-03-31 20:42:42 -0700
committerJohn MacFarlane <[email protected]>2025-03-31 20:42:42 -0700
commit69feb5ea9a9d83a15d196571e8d7d1ad800d7f7a (patch)
tree607d0d22b274cd512e2491088f38ff3ad1b9c0a6 /src
parent2a53e25facd7494d98aab3b13d9a509d4631290f (diff)
Ms writer: ensure no line breaks in '.pdfhref O'.
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Writers/Ms.hs9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/Text/Pandoc/Writers/Ms.hs b/src/Text/Pandoc/Writers/Ms.hs
index 6fca72dde..242cfaa46 100644
--- a/src/Text/Pandoc/Writers/Ms.hs
+++ b/src/Text/Pandoc/Writers/Ms.hs
@@ -200,14 +200,15 @@ blockToMs opts (Header level (ident,classes,_) inlines) = do
literal ".pdfhref M "
<> doubleQuotes (literal (toAscii ident))
let bookmark = literal ".pdfhref O " <> literal (tshow level <> " ") <>
- doubleQuotes (literal $ secnum <>
+ nowrap (doubleQuotes
+ (literal $ secnum <>
(if T.null secnum
then ""
else " ") <>
(case mbPdfEngine of
Just "groff" -> id
_ -> escapePDFString)
- plainContents)
+ plainContents))
let backlink = nowrap (literal ".pdfhref L -D " <>
doubleQuotes (literal (toAscii ident)) <> space <> literal "\\") <> cr <>
literal " -- "
@@ -676,5 +677,5 @@ getSizeAttrs opts attr =
mbH = inPoints opts <$> dimension Height attr
inlinesToPlain :: PandocMonad m => [Inline] -> m Text
-inlinesToPlain ils =
- T.strip <$> writePlain def (Pandoc nullMeta [Plain ils])
+inlinesToPlain ils = T.strip <$> writePlain def{ writerWrapText = WrapNone }
+ (Pandoc nullMeta [Plain ils])