Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions tests/selenium/test_selenium.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,17 @@ def __init__(self):
def handle_starttag(self, tag, attrs):
if tag == 'iframe':
attrs = dict(attrs)
if 'data-html' in attrs:
if 'srcdoc' in attrs:
html_bytes = attrs['srcdoc'].encode()
elif 'data-html' in attrs: # legacy
data_html = attrs['data-html']
if '%' in data_html[:20]:
# newest branca version: data-html is percent-encoded
html_bytes = unquote(data_html).encode()
else:
# legacy branca version: data-html is base64 encoded
html_bytes = base64.b64decode(data_html)
else: # legacy, can be removed when all notebooks have `data-html`.
else: # legacy
src = attrs['src']
html_base64 = src.split(',')[-1]
html_bytes = base64.b64decode(html_base64)
Expand Down