Commit 640b6966 authored by Tristan Cavelier's avatar Tristan Cavelier

erp5_web: handle style attributes in web page object extraction scripts

- WebPage_exportAsSingleFile
- WebPage_extractReferredObjectDict
parent ce9edca7
......@@ -69,6 +69,9 @@ def handleHtmlTag(tag, attrs):
for i in range(len(attrs)):
if attrs[i][0] == "href" or attrs[i][0] == "src":
attrs[i] = attrs[i][0], makeHrefAbsolute(attrs[i][1])
for i in range(len(attrs)):
if attrs[i][0] == "style":
attrs[i] = attrs[i][0], replaceCssUrl(attrs[i][1])
return tag, attrs
def strHtmlPart(part):
......
......@@ -31,6 +31,10 @@ def handleHtmlTag(tag, attrs):
for i in range(len(attrs)):
if attrs[i][0] in ("src", "href"):
handleHref(attrs[i][1])
for i in range(len(attrs)):
if attrs[i][0] == "style":
handleCss(attrs[i][1])
on_next_data = [lambda x: x]
def handleHtmlPart(part):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment