File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -70,15 +70,17 @@ def __init__(self):
7070 def handle_starttag (self , tag , attrs ):
7171 if tag == 'iframe' :
7272 attrs = dict (attrs )
73- if 'data-html' in attrs :
73+ if 'srcdoc' in attrs :
74+ html_bytes = attrs ['srcdoc' ].encode ()
75+ elif 'data-html' in attrs : # legacy
7476 data_html = attrs ['data-html' ]
7577 if '%' in data_html [:20 ]:
7678 # newest branca version: data-html is percent-encoded
7779 html_bytes = unquote (data_html ).encode ()
7880 else :
7981 # legacy branca version: data-html is base64 encoded
8082 html_bytes = base64 .b64decode (data_html )
81- else : # legacy, can be removed when all notebooks have `data-html`.
83+ else : # legacy
8284 src = attrs ['src' ]
8385 html_base64 = src .split (',' )[- 1 ]
8486 html_bytes = base64 .b64decode (html_base64 )
You can’t perform that action at this time.
0 commit comments