diff options
author | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2017-03-08 12:28:28 +0100 |
---|---|---|
committer | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2017-03-08 12:28:28 +0100 |
commit | 5b4215eb166554a2a358be457318c4dab5a5b55d (patch) | |
tree | 86da36b932dfbae1a8d4fa2f6f919fc08bd844fc | |
parent | 2eda74285e082ccdb4d9413ae66606fce49a1368 (diff) | |
download | org-mode-5b4215eb166554a2a358be457318c4dab5a5b55d.tar.gz |
ox-ascii: Remove useless brackets in sub/super script
* lisp/ox-ascii.el (org-ascii-subscript):
(org-ascii-superscript): Only use brackets when there are multiple
words.
-rw-r--r-- | lisp/ox-ascii.el | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/lisp/ox-ascii.el b/lisp/ox-ascii.el index 2a129e9..e0419d9 100644 --- a/lisp/ox-ascii.el +++ b/lisp/ox-ascii.el @@ -1790,9 +1790,7 @@ CONTENTS is nil. INFO is a plist holding contextual information." "Transcode a SUBSCRIPT object from Org to ASCII. CONTENTS is the contents of the object. INFO is a plist holding contextual information." - (if (org-element-property :use-brackets-p subscript) - (format "_{%s}" contents) - (format "_%s" contents))) + (format (if (string-match-p "[ \t]" contents) "_{%s}" "_%s") contents)) ;;;; Superscript @@ -1801,9 +1799,7 @@ contextual information." "Transcode a SUPERSCRIPT object from Org to ASCII. CONTENTS is the contents of the object. INFO is a plist holding contextual information." - (if (org-element-property :use-brackets-p superscript) - (format "^{%s}" contents) - (format "^%s" contents))) + (format (if (string-match-p "[ \t]" contents) "^{%s}" "^%s") contents)) ;;;; Strike-through |