lisp/ox-odt.el (org-odt-item): Fix table hack inside nested list

* lisp/ox-odt.el (org-odt-item): When exporting table inside a list,
fix scenario when the table is located inside a sub-list of another
list.

Reported-by: Christian Moe <mail@christianmoe.com>
Link: https://orgmode.org/list/87edxn9z7n.fsf@localhost
This commit is contained in:
Ihor Radchenko 2024-04-05 13:12:30 +03:00
parent 90045c45e2
commit ef43642874
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
1 changed files with 10 additions and 1 deletions

View File

@ -1945,7 +1945,16 @@ contextual information."
(format "\n<text:list-item%s>\n%s\n%s"
(if count (format " text:start-value=\"%s\"" count) "")
contents
(if (org-element-map item 'table #'identity info 'first-match)
(if (org-element-map item
'table #'identity info 'first-match
;; Ignore tables inside sub-lists.
'(plain-list))
;; `org-odt-table' will splice forced list ending (all
;; the way up to the topmost list parent), table, and
;; forced list re-opening in the middle of the item,
;; marking text after table with <text:list-header>
;; So, we must match close </text:list-header> instead
;; of the original </text:list-item>.
"</text:list-header>"
"</text:list-item>"))))