File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -357,16 +357,13 @@ def render_footnotes(
357
357
if jinja_env is None :
358
358
jinja_env = Environment ()
359
359
360
- for k , v in self .docx .sections [0 ].part .related_parts .items ():
361
- if v .content_type == 'application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml' :
362
- from lxml import etree as ET
363
- tree = ET .fromstring (v .blob )
360
+ for part in self .docx .sections [0 ].part .package .parts :
361
+ if part .content_type == 'application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml' :
362
+ tree = etree .fromstring (part .blob )
364
363
for footnote in tree .findall ('.//w:t' , docx .oxml .ns .nsmap ):
365
364
if hasattr (footnote , 'text' ):
366
365
footnote .text = jinja_env .from_string (footnote .text ).render (context )
367
- for part in self .docx .sections [0 ].part .related_parts [k ].package .parts :
368
- if part .partname == v .partname :
369
- part ._blob = ET .tostring (tree , encoding = 'unicode' ).encode ('utf8' )
366
+ part ._blob = etree .tostring (tree )
370
367
371
368
def resolve_listing (self , xml ):
372
369
You can’t perform that action at this time.
0 commit comments