diff options
author | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2017-06-08 15:14:48 +0200 |
---|---|---|
committer | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2017-06-08 15:14:48 +0200 |
commit | f03387ef90c9adff1388773cc33b755669d97601 (patch) | |
tree | 37c17e0db4fcc2f0e43453489249c84cfd22fb2c | |
parent | 3cf6345b408803486f72c524654439401e716493 (diff) | |
download | org-mode-f03387ef90c9adff1388773cc33b755669d97601.tar.gz |
ox-texinfo: Fix special characters in plain text
* lisp/ox-texinfo.el (org-texinfo-plain-text): Add missing
discretionary hyphenation point. Tiny refactoring.
-rw-r--r-- | lisp/ox-texinfo.el | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/lisp/ox-texinfo.el b/lisp/ox-texinfo.el index 02de937..7ffcffb 100644 --- a/lisp/ox-texinfo.el +++ b/lisp/ox-texinfo.el @@ -1234,16 +1234,14 @@ contextual information." (setq output (org-export-activate-smart-quotes output :texinfo info text))) ;; LaTeX into @LaTeX{} and TeX into @TeX{} - (let ((case-fold-search nil) - (start 0)) - (while (string-match "\\(\\(?:La\\)?TeX\\)" output start) - (setq output (replace-match - (format "@%s{}" (match-string 1 output)) nil t output) - start (match-end 0)))) + (let ((case-fold-search nil)) + (setq output (replace-regexp-in-string "\\(?:La\\)?TeX" "@\\&{}" output))) ;; Convert special strings. (when (plist-get info :with-special-strings) - (while (string-match (regexp-quote "...") output) - (setq output (replace-match "@dots{}" nil t output)))) + (setq output + (replace-regexp-in-string + "\\.\\.\\." "@dots{}" + (replace-regexp-in-string "\\\\-" "@-" output)))) ;; Handle break preservation if required. (when (plist-get info :preserve-breaks) (setq output (replace-regexp-in-string |