summaryrefslogtreecommitdiff
path: root/bin/report/render/html2html
diff options
context:
space:
mode:
authorChristophe Simonis <christophe@tinyerp.com>2009-06-10 13:53:07 +0200
committerChristophe Simonis <christophe@tinyerp.com>2009-06-10 13:53:07 +0200
commite12f2d28a3d58fb8d8de9a0d200201f3d01b2fea (patch)
treeac3dbb4b189f0a279acbbed4aaabca1ac4bc15f7 /bin/report/render/html2html
parent7aa507e708f9a242b8993e7a9725e20023d93a73 (diff)
parent683f3fe232c5a696bd00d9ec10a69af7d36fcb4a (diff)
[MERGE]
bzr revid: christophe@tinyerp.com-20090610115307-spfs77tmwcrclx7o
Diffstat (limited to 'bin/report/render/html2html')
-rw-r--r--bin/report/render/html2html/html2html.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/bin/report/render/html2html/html2html.py b/bin/report/render/html2html/html2html.py
index 2cf5b147dd0..1fc63572a0f 100644
--- a/bin/report/render/html2html/html2html.py
+++ b/bin/report/render/html2html/html2html.py
@@ -71,8 +71,20 @@ class html2html(object):
self._node.remove(n)
process_text(self.etree, self._node)
return self._node
+
+ def url_modify(self,root):
+ for n in root.getchildren():
+ if n.text.find('<a ')>=0 and n.text.find('style')<=0 :
+ node = (n.tag=='span' and n.getparent().tag=='u') and n.getparent().getparent() or ((n.tag=='span') and n.getparent()) or n
+ style = node.get('color') and "style='color:%s; text-decoration: none;'"%node.get('color') or ''
+ href = n.text.split('<a ')[-1]
+ n.text = ' '.join(['<a ',style,href])
+ self.url_modify(n)
+ return root
def parseString(node, localcontext = {}):
r = html2html(node, localcontext)
- return r.render()
+ root = r.render()
+ root = r.url_modify(root)
+ return root