ox-texinfo: Fix special characters in plain text

* lisp/ox-texinfo.el (org-texinfo-plain-text): Add missing
  discretionary hyphenation point.  Tiny refactoring.
This commit is contained in:
Nicolas Goaziou 2017-06-08 15:14:48 +02:00
parent 3cf6345b40
commit f03387ef90
1 changed files with 6 additions and 8 deletions

View File

@ -1234,16 +1234,14 @@ contextual information."
(setq output (setq output
(org-export-activate-smart-quotes output :texinfo info text))) (org-export-activate-smart-quotes output :texinfo info text)))
;; LaTeX into @LaTeX{} and TeX into @TeX{} ;; LaTeX into @LaTeX{} and TeX into @TeX{}
(let ((case-fold-search nil) (let ((case-fold-search nil))
(start 0)) (setq output (replace-regexp-in-string "\\(?:La\\)?TeX" "@\\&{}" output)))
(while (string-match "\\(\\(?:La\\)?TeX\\)" output start)
(setq output (replace-match
(format "@%s{}" (match-string 1 output)) nil t output)
start (match-end 0))))
;; Convert special strings. ;; Convert special strings.
(when (plist-get info :with-special-strings) (when (plist-get info :with-special-strings)
(while (string-match (regexp-quote "...") output) (setq output
(setq output (replace-match "@dots{}" nil t output)))) (replace-regexp-in-string
"\\.\\.\\." "@dots{}"
(replace-regexp-in-string "\\\\-" "@-" output))))
;; Handle break preservation if required. ;; Handle break preservation if required.
(when (plist-get info :preserve-breaks) (when (plist-get info :preserve-breaks)
(setq output (replace-regexp-in-string (setq output (replace-regexp-in-string