Skip to content

Commit 7eb6efe

Browse files
committed
Add way to generate multiple Presenter slides from one
1 parent b6221cf commit 7eb6efe

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

seleniumbase/fixtures/base_case.py

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10892,7 +10892,31 @@ def add_slide(
1089210892
html += "%s%s" % (add_line, content2)
1089310893
html += '\n<aside class="notes">%s</aside>' % notes
1089410894
html += "\n</section>\n"
10895-
self._presentation_slides[name].append(html)
10895+
if "<mk-0>" not in html and "<mk-1>" not in html:
10896+
self._presentation_slides[name].append(html)
10897+
else:
10898+
# Generate multiple slides with <mark> and </mark>
10899+
replacements = False
10900+
for num in range(32):
10901+
if "<mk-%s>" % num in html and "</mk-%s>" % num in html:
10902+
replacements = True
10903+
new_html = html
10904+
new_html = new_html.replace("<mk-%s>" % num, "<mark>")
10905+
new_html = new_html.replace("</mk-%s>" % num, "</mark>")
10906+
for num2 in range(32):
10907+
if num2 == num:
10908+
continue
10909+
if "<mk-%s>" % num2 not in new_html and num2 >= 2:
10910+
break
10911+
new_html = new_html.replace("<mk-%s>" % num2, "")
10912+
new_html = new_html.replace("</mk-%s>" % num2, "")
10913+
self._presentation_slides[name].append(new_html)
10914+
else:
10915+
if num >= 2:
10916+
break
10917+
if not replacements:
10918+
# A <mark> is missing a closing tag. Do one.
10919+
self._presentation_slides[name].append(html)
1089610920

1089710921
def save_presentation(
1089810922
self, name=None, filename=None, show_notes=False, interval=0

0 commit comments

Comments
 (0)