Pass extra parameter to children of multipart/alternative
A structure like this is quite common: ─><no description> [multipa/related, 7bit, 12K] ├─><no description> [multipa/alternativ, 7bit, 9.0K] │ ├─><no description> [text/plain, quoted, iso-8859-1, 3.7K] │ └─><no description> [text/html, quoted, iso-8859-1, 4.9K] └─>2b0063.jpg [image/jpeg, base64, 3.3K] Here the main content of multipart/related isn't the html part, but a multipart/alternative containing the html part and a text part. The html part still needs access to the onther content of the multipart/related part, so we need to pass this through.
This commit is contained in:
parent
a44ff7ee4b
commit
c84c517f62
2
mbox2web
2
mbox2web
|
@ -254,7 +254,7 @@ def render_body(msg, extra=None):
|
||||||
partstypes = []
|
partstypes = []
|
||||||
for part in msg.get_payload():
|
for part in msg.get_payload():
|
||||||
partstypes.append(part.get_content_type())
|
partstypes.append(part.get_content_type())
|
||||||
partshtml.append(render_body(part))
|
partshtml.append(render_body(part, extra))
|
||||||
bodytmpl = jenv.get_template("body_multipart_alternative.html")
|
bodytmpl = jenv.get_template("body_multipart_alternative.html")
|
||||||
context = {
|
context = {
|
||||||
"types": partstypes,
|
"types": partstypes,
|
||||||
|
|
Loading…
Reference in New Issue