Damien Cassou <[email protected]> writes:
> Ihor Radchenko <[email protected]> writes:
>> Damien Cassou <[email protected]> writes:
>>> (defun ox-linuxmag--item (item contents info)
>>> ...
>>> The reason `ox-linuxmag--item` has to parse ITEM again is because
>>> CONTENTS contains "<text:p text:style-name="Normal">item 1 ;</text:p>"
>>> which misses the initial dash "-" character: i.e., I would like "- item
>>> 1 ;" in the paragraph instead.
After a quick chat with yantar92 on IRC, I understood that the easiest
solution is to fix the paragraph transcoder to inject the "- " when its
parent is an item. The item transcoder can just return CONTENTS.
Here is the corresponding code:
(defun ox-linuxmag--paragraph (paragraph contents info)
"Transcode a PARAGRAPH element from Org to ODT.
CONTENTS is the contents of the paragraph, as a string. INFO is
the plist used as a communication channel."
(let* ((parent (org-export-get-parent paragraph))
(parent-type (org-element-type parent))
(prefix (when (eq parent-type 'item) "- ")))
(org-odt--format-paragraph
paragraph
(concat prefix contents)
info
(or (org-element-property :style paragraph) "Normal")
""
"")))))
Thank you so much for your help.
--
Damien Cassou
"Success is the ability to go from one failure to another without
losing enthusiasm." --Winston Churchill