Modify

Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#6931 closed defect (wontfix)

replace_keyword ingored in odt template

Reported by: entend Owned by: Aurélien Bompard
Priority: normal Component: OdtExportPlugin
Severity: normal Keywords:
Cc: Trac Release: 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.

Attachments (1)

template.odt (8.9 KB) - added by entend 14 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 Changed 14 years ago by entend

  • I used OpenOffice 3.2.0 Build: 9483

comment:2 Changed 14 years ago by anonymous

  • I use OpenOffice 3.2.0 Build: 9483

Changed 14 years ago by entend

Attachment: template.odt added

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

Resolution: wontfix
Status: newclosed

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 Changed 14 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 14 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 14 years ago by anonymous

Replying to anonymous:

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

Replying to abompard:

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

It is not required. Thanks, great plugin

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Aurélien Bompard.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.