ox-man: Fix verbatim markup

* lisp/ox-man.el (org-man--protect-text): New function.
(org-man-code): Use new function.
(org-man-verbatim): Use inline markup.
This commit is contained in:
Nicolas Goaziou 2017-10-19 21:51:31 +02:00
parent ee24c0769b
commit 37142cea78
1 changed files with 8 additions and 2 deletions

View File

@ -285,6 +285,10 @@ This function shouldn't be used for floats. See
output
(concat (format "%s\n.br\n" label) output))))
(defun org-man--protect-text (text)
"Protect minus and backslash characters in string TEXT."
(replace-regexp-in-string "-" "\\-" nil t))
;;; Template
@ -351,7 +355,8 @@ holding contextual information."
(defun org-man-code (code _contents _info)
"Transcode a CODE object from Org to Man."
(format "\\fC%s\\fP" (org-element-property :value code)))
(format "\\fC%s\\fP"
(org-man--protect-text (org-element-property :value code))))
;;; Drawer
@ -1029,7 +1034,8 @@ holding contextual information."
(defun org-man-verbatim (verbatim _contents _info)
"Transcode a VERBATIM object from Org to Man."
(format ".nf\n%s\n.fi" (org-element-property :value verbatim)))
(format "\\fI%s\\fP"
(org-man--protect-text (org-element-property :value verbatim))))
;;; Verse Block