aboutsummaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-03-26 10:44:34 +0200
committerJohn MacFarlane <jgm@berkeley.edu>2017-03-26 10:44:34 +0200
commitd9e8e84be0fb873b90abc8cc43e66f83f17e0d83 (patch)
tree15c7355c2a40c6cb21846ffe74141c2c04eb3c9b /src/Text
parente8d8d8721a7abfcf6660ab1981130129bdb9950f (diff)
downloadpandoc-d9e8e84be0fb873b90abc8cc43e66f83f17e0d83.tar.gz
Ms writer: better placement of header anchors.
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Writers/Ms.hs14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/Text/Pandoc/Writers/Ms.hs b/src/Text/Pandoc/Writers/Ms.hs
index 4c6cc5a34..5fbc54543 100644
--- a/src/Text/Pandoc/Writers/Ms.hs
+++ b/src/Text/Pandoc/Writers/Ms.hs
@@ -29,16 +29,12 @@ Conversion of 'Pandoc' documents to groff ms format.
TODO:
-[ ] is there a way to avoid the extra space between internal links
- and following punctuation?
- internal links followed by a space also cause bad formatting
- (a line break)
- but adding \c at the end of the link text doesn't seem to work
+[ ] external links
+ http://pipeline.lbl.gov/code/3rd_party/licenses.win/groff/1.19.2/pdf/pdfmark.pdf
[ ] manually create TOC including internal links and pdf outline
bookmarks? See
http://pipeline.lbl.gov/code/3rd_party/licenses.win/groff/1.19.2/pdf/pdfmark.pdf
[ ] is there a better way to do strikeout?
-[ ] options for hyperlink rendering (currently footnote)
[ ] tight/loose list distinction
-}
@@ -250,7 +246,7 @@ blockToMs _ HorizontalRule = do
return $ text ".HLINE"
blockToMs opts (Header level (ident,classes,_) inlines) = do
setFirstPara
- contents <- inlineListToMs' opts inlines
+ contents <- inlineListToMs' opts $ map breakToSpace inlines
let anchor = if null ident
then empty
else nowrap $
@@ -266,9 +262,9 @@ blockToMs opts (Header level (ident,classes,_) inlines) = do
then ".NH"
else ".SH"
modify $ \st -> st{ stFirstPara = True }
- return $ anchor $$
- (text heading <> space <> text (show level)) $$
+ return $ (text heading <> space <> text (show level)) $$
contents $$
+ anchor $$
tocEntry
blockToMs _ (CodeBlock _ str) = do
setFirstPara