summaryrefslogtreecommitdiff
path: root/lisp/ox-odt.el
diff options
context:
space:
mode:
authorNicholas D Steeves <nsteeves@gmail.com>2017-07-03 20:44:19 -0400
committerNicholas D Steeves <nsteeves@gmail.com>2017-07-03 20:57:31 -0400
commit3458b4fdfffc1b4f542405325ffa8b6eed0eb1df (patch)
tree0c9ed6fcddc796bdb92d3fc5fd266fac3b583eda /lisp/ox-odt.el
parent969f455bc143bb93c745b82db358392b123661e0 (diff)
New upstream version 9.0.9+dfsg
Diffstat (limited to 'lisp/ox-odt.el')
-rw-r--r--lisp/ox-odt.el35
1 files changed, 14 insertions, 21 deletions
diff --git a/lisp/ox-odt.el b/lisp/ox-odt.el
index 2465836..943a6be 100644
--- a/lisp/ox-odt.el
+++ b/lisp/ox-odt.el
@@ -1,6 +1,6 @@
;;; ox-odt.el --- OpenDocument Text Exporter for Org Mode -*- lexical-binding: t; -*-
-;; Copyright (C) 2010-2016 Free Software Foundation, Inc.
+;; Copyright (C) 2010-2017 Free Software Foundation, Inc.
;; Author: Jambunathan K <kjambunathan at gmail dot com>
;; Keywords: outlines, hypermedia, calendar, wp
@@ -673,7 +673,7 @@ TAGS the tags string, separated with colons (string or nil).
The function result will be used as headline text."
:group 'org-export-odt
- :version "25.2"
+ :version "26.1"
:package-version '(Org . "8.3")
:type 'function)
@@ -694,7 +694,7 @@ The function must accept six parameters:
The function should return the string to be exported."
:group 'org-export-odt
- :version "25.2"
+ :version "26.1"
:package-version '(Org . "8.3")
:type 'function)
@@ -753,7 +753,7 @@ A rule consists in an association whose key is the type of link
to consider, and value is a regexp that will be matched against
link's path."
:group 'org-export-odt
- :version "25.2"
+ :version "26.1"
:package-version '(Org . "8.3")
:type '(alist :key-type (string :tag "Type")
:value-type (regexp :tag "Path")))
@@ -2882,15 +2882,10 @@ contextual information."
(defun org-odt--encode-tabs-and-spaces (line)
(replace-regexp-in-string
- "\\([\t]\\|\\([ ]+\\)\\)"
+ "\\(\t\\| \\{2,\\}\\)"
(lambda (s)
- (cond
- ((string= s "\t") "<text:tab/>")
- (t (let ((n (length s)))
- (cond
- ((= n 1) " ")
- ((> n 1) (concat " " (format "<text:s text:c=\"%d\"/>" (1- n))))
- (t ""))))))
+ (if (string= s "\t") "<text:tab/>"
+ (format " <text:s text:c=\"%d\"/>" (1- (length s)))))
line))
(defun org-odt--encode-plain-text (text &optional no-whitespace-filling)
@@ -3673,15 +3668,13 @@ channel."
"Transcode a VERSE-BLOCK element from Org to ODT.
CONTENTS is verse block contents. INFO is a plist holding
contextual information."
- ;; Add line breaks to each line of verse.
- (setq contents (replace-regexp-in-string
- "\\(<text:line-break/>\\)?[ \t]*\n"
- "<text:line-break/>" contents))
- ;; Replace tabs and spaces.
- (setq contents (org-odt--encode-tabs-and-spaces contents))
- ;; Surround it in a verse environment.
- (format "\n<text:p text:style-name=\"%s\">%s</text:p>"
- "OrgVerse" contents))
+ (format "\n<text:p text:style-name=\"OrgVerse\">%s</text:p>"
+ (replace-regexp-in-string
+ ;; Replace leading tabs and spaces.
+ "^[ \t]+" #'org-odt--encode-tabs-and-spaces
+ ;; Add line breaks to each line of verse.
+ (replace-regexp-in-string
+ "\\(<text:line-break/>\\)?[ \t]*$" "<text:line-break/>" contents))))