return output_html, toc, chars
+def flatten_image_paths(wldoc):
+ root = wldoc.edoc.getroot()
+ for node in root.findall(".//ilustr"):
+ node.attrib['src'] = os.path.basename(node.attrib['src'])
+ return wldoc
+
def render_latex(wldoc, prefix="latex"):
"""
Renders <latex>CODE</latex> as images and returns
if main_text.tag == RDFNS('RDF'):
main_text = None
+ flatten_image_paths(wldoc)
+
if main_text is not None:
for chunk_xml in chop(main_text):
empty = False