Modify

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#6931 closed defect (wontfix)

replace_keyword ingored in odt template

Reported by: pnzhdin@… Owned by: abompard
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 pnzhdin@… 5 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 Changed 5 years ago by pnzhdin@…

  • I used OpenOffice 3.2.0 Build: 9483

comment:2 Changed 5 years ago by anonymous

  • I use OpenOffice 3.2.0 Build: 9483

Changed 5 years ago by pnzhdin@…

comment:3 Changed 5 years ago by abompard

  • Resolution set to wontfix
  • Status changed from new to 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: Changed 5 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 5 years ago by abompard

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

comment:6 in reply to: ↑ 4 Changed 5 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

Add Comment

Modify Ticket

Action
as closed The owner will remain abompard.
The resolution will be deleted. Next status will be 'reopened'.
Author


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

 
Note: See TracTickets for help on using tickets.