diff options
| author | dsh (Open ERP) <dsh@tinyerp.com> | 2009-06-10 16:53:28 +0530 |
|---|---|---|
| committer | dsh (Open ERP) <dsh@tinyerp.com> | 2009-06-10 16:53:28 +0530 |
| commit | 683f3fe232c5a696bd00d9ec10a69af7d36fcb4a (patch) | |
| tree | b06a5c48ff0d46e30182de5dcda196790dd4b8dc /bin/report/render/html2html/html2html.py | |
| parent | 5992ca03891044651cd94e3c1626be87aa5614fe (diff) | |
[IMP] added style for the url which are as text
bzr revid: dsh@tinyerp.com-20090610112328-0rd3cr2ig132yt12
Diffstat (limited to 'bin/report/render/html2html/html2html.py')
| -rw-r--r-- | bin/report/render/html2html/html2html.py | 14 |
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 |
