From 69feb5ea9a9d83a15d196571e8d7d1ad800d7f7a Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Mon, 31 Mar 2025 20:42:42 -0700 Subject: Ms writer: ensure no line breaks in '.pdfhref O'. --- src/Text/Pandoc/Writers/Ms.hs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src') 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]) -- cgit v1.2.3