Skip to content

Commit

Permalink
Merge pull request #18 from DamienCassou/tables
Browse files Browse the repository at this point in the history
Tables
  • Loading branch information
DamienCassou committed Apr 7, 2023
2 parents 2c06d54 + e88c4b8 commit 3cec816
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ox-linuxmag-fr.el
Expand Up @@ -446,7 +446,7 @@ CONTENTS is nil. INFO is a plist used as a communication
channel."
(concat
(format "<table:table-cell table:style-name=\"Tableau.A1\" office:value-type=\"string\">")
(ox-linuxmag-fr--format-textp contents)
(when contents (ox-linuxmag-fr--format-textp contents))
(format "</table:table-cell>")))

(defun ox-linuxmag-fr--target (target _contents _info)
Expand Down Expand Up @@ -586,7 +586,7 @@ added to the archive."

(defun ox-linuxmag-fr--add-files-to-archive-directory (archive-directory odt-file figure-files)
"Add ODT-FILE and FIGURE-FILES to ARCHIVE-DIRECTORY."
(rename-file odt-file archive-directory)
(copy-file odt-file archive-directory)
(ox-linuxmag-fr--copy-figure-files-to-archive-directory figure-files archive-directory))

(defun ox-linuxmag-fr--copy-figure-files-to-archive-directory (figure-files archive-directory)
Expand Down
10 changes: 10 additions & 0 deletions test/ox-linuxmag-fr-tests.el
Expand Up @@ -269,9 +269,19 @@ ls --size
(should (ox-linuxmag-fr-tests-contain "<table:table-column table:style-name=\"Tableau.A\" table:number-columns-repeated=\"2\"/>"))
(should (ox-linuxmag-fr-tests-contain "<table:table-cell table:style-name=\"Tableau.A1\" office:value-type=\"string\">"))
(should (ox-linuxmag-fr-tests-contain "<text:p text:style-name=\"Normal\">cell1.1</text:p>"))
(should (ox-linuxmag-fr-tests-contain "<text:p text:style-name=\"Normal\">cell1.2</text:p>"))
(should (ox-linuxmag-fr-tests-contain "<text:p text:style-name=\"Normal\">cell2.1</text:p>"))
(should (ox-linuxmag-fr-tests-contain "<text:p text:style-name=\"Normal\">cell2.2</text:p>"))
(should (ox-linuxmag-fr-tests-contain "</table:table-cell>"))
(should (ox-linuxmag-fr-tests-contain "</table:table>")))

(ert-deftest ox-linuxmag-fr-tests-table-empty-cell ()
(ox-linuxmag-fr-tests-export "
| cell1.1 | |
")
(should (ox-linuxmag-fr-tests-contain "cell1.1"))
(should (ox-linuxmag-fr-tests-contain "<table:table-cell table:style-name=\"Tableau.A1\" office:value-type=\"string\"></table:table-cell>")))

(ert-deftest ox-linuxmag-fr-tests-target ()
(ox-linuxmag-fr-tests-export "<<1>> foo")
(should (ox-linuxmag-fr-tests-contain "<text:span text:style-name=\"gras\">[1]</text:span> foo")))
Expand Down

0 comments on commit 3cec816

Please sign in to comment.