emacs-unoffice

Emacs library to reclaim text from office documents (abw, odt, docx).
Log | Files | Refs

commit 21819a41d3f14226e96dddff8a48324297638b0a
parent 3dd05a7375c00219cf6d8cdd3f27f0c778cd6a9a
Author: Tomas Hlavaty <tom@logand.com>
Date:   Sun, 31 Jan 2021 23:29:06 +0100

fix abw align

Diffstat:
Memacs-unoffice.el | 8+++++---
1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/emacs-unoffice.el b/emacs-unoffice.el @@ -185,13 +185,13 @@ (rec x)))) (defun unoffice--from-abw () - (let (z align pp p) + (let* (z (left '(left)) (align left) pp p) (cl-labels ((alignment (x) (let ((props (xml-get-attribute x 'props))) (when props (cond ((cl-search "text-align:left" props) - '(left)) + left) ((cl-search "text-align:center" props) '(center)) ((cl-search "text-align:right" props) @@ -209,7 +209,9 @@ p nil) (let ((a (alignment x))) (unless (eq align a) - (push (setq align a) z))) + (setq align a) + (when align + (push align z)))) (mapc #'rec (cddr x)) (push (cons 'p (nreverse p)) z) (setq pp nil))