diff options
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r-- | src/Text/Pandoc/Writers/Ms.hs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Writers/Ms.hs b/src/Text/Pandoc/Writers/Ms.hs index 60e1f6041..0536e0cfb 100644 --- a/src/Text/Pandoc/Writers/Ms.hs +++ b/src/Text/Pandoc/Writers/Ms.hs @@ -249,6 +249,8 @@ blockToMs opts (Header level (ident,classes,_) inlines) = do then empty else nowrap $ text ".pdfhref M " <> doubleQuotes (text ident) + let bookmark = text ".pdfhref O " <> text (show level ++ " ") <> + doubleQuotes (text (escapeString (stringify inlines))) let tocEntry = if writerTableOfContents opts && level <= writerTOCDepth opts then text ".XS" $$ @@ -262,6 +264,7 @@ blockToMs opts (Header level (ident,classes,_) inlines) = do modify $ \st -> st{ stFirstPara = True } return $ (text heading <> space <> text (show level)) $$ contents $$ + bookmark $$ anchor $$ tocEntry blockToMs _ (CodeBlock _ str) = do |