From 683f3fe232c5a696bd00d9ec10a69af7d36fcb4a Mon Sep 17 00:00:00 2001 From: "dsh (Open ERP)" Date: Wed, 10 Jun 2009 16:53:28 +0530 Subject: [IMP] added style for the url which are as text bzr revid: dsh@tinyerp.com-20090610112328-0rd3cr2ig132yt12 --- bin/report/render/html2html/html2html.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'bin/report/render/html2html/html2html.py') 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('=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(' Date: Wed, 10 Jun 2009 19:19:19 +0530 Subject: [FIX] fix &,<,> problem for html2html-url report bzr revid: dsh@tinyerp.com-20090610134919-x3hkueo10dlrqkn5 --- bin/report/render/html2html/html2html.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'bin/report/render/html2html/html2html.py') diff --git a/bin/report/render/html2html/html2html.py b/bin/report/render/html2html/html2html.py index 1fc63572a0f..db6a1ea511c 100644 --- a/bin/report/render/html2html/html2html.py +++ b/bin/report/render/html2html/html2html.py @@ -74,11 +74,15 @@ class html2html(object): def url_modify(self,root): for n in root.getchildren(): - if n.text.find('=0 and n.text.find('style')<=0 : + if (n.text.find('=0 or n.text.find('<a')>=0) and n.text.find('href')>=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('=0: + t = '<a ' + else : + t = '