Opened 8 years ago

Closed 8 years ago

replace_keyword ingored in odt template

Reported by: Owned by: entend Aurélien Bompard normal OdtExportPlugin normal 0.11

Description

I used OpenOffice 3.2.0 Build: 9483. My template file template.odt is attached below. replace_keyword (in my case it is TRAC-ODT-INSERT) is ignored by export plugin. Btw, cut_start_keyword and cut_stop_keyword works fine.

P.S. I suspect that the problem in insert_content(self, content) function between http://trac-hacks.org/browser/odtexportplugin/0.11/odtexport/odtexport.py?rev=7811#L354 and http://trac-hacks.org/browser/odtexportplugin/0.11/odtexport/odtexport.py?rev=7811#L357 lines:

#...
self.xml["content"] = re.sub(
"<text:p[^>]*>" +
re.escape(self.options["replace_keyword"])
+"</text:p>", content, self.xml["content"])
#...


You believe that replace_keyword will be between <text:p...> and </text:p> tags, but in my case replace_keyword is placed between <text:span...> and </text:span> if i not mistaken.

comment:1 Changed 8 years ago by entend

• I used OpenOffice 3.2.0 Build: 9483

comment:2 Changed 8 years ago by anonymous

• I use OpenOffice 3.2.0 Build: 9483

comment:3 Changed 8 years ago by Aurélien Bompard

Resolution: → wontfix new → closed

Yes, I have (found) no way to predict all the formattings people could apply to the INSERT keyword, so I just assume it's alone on its own line.

Maybe that should be added to the documentation on the wiki.

comment:4 follow-up:  6 Changed 8 years ago by anonymous

As workaround, you can replace 'replace_keyword' by replace_start_keyword and replace_stop_keyword, how you think ?

comment:5 Changed 8 years ago by Aurélien Bompard

I don't understand what you are proposing, how would that work ?

comment:6 in reply to:  4 Changed 8 years ago by anonymous

As workaround, you can replace 'replace_keyword' by replace_start_keyword and replace_stop_keyword, how you think ?

I don't understand what you are proposing, how would that work ?

It is not required. Thanks, great plugin

Modify Ticket

Change Properties