Here is the stack dump when trying to kill the app while it is leaking:
blocked main thread for 1760ms:
File "<string>", line 1, in <module>
File "aqt", line 514, in run
File "aqt", line 728, in _run
File "aqt.webview", line 50, in cmd
File "aqt.webview", line 157, in _onCmd
File "aqt.webview", line 686, in _onBridgeCmd
File "aqt.editor", line 514, in onBridgeCmd
File "aqt.browser.browser", line 531, in <lambda>
File "aqt.browser.browser", line 747, in onTogglePreview
File "aqt.browser.previewer", line 68, in open
File "aqt.browser.previewer", line 169, in render_card
File "aqt.browser.previewer", line 370, in _render_scheduled
File "aqt.browser.previewer", line 202, in _render_scheduled
File "anki.cards", line 139, in question
File "anki.cards", line 155, in render_output
File "anki.template", line 225, in render
File "anki.template", line 272, in _partially_render
File "anki._backend_generated", line 1437, in render_existing_card
File "anki._backend", line 169, in _run_command
The issue happens with 12 > stacked clozes - that takes about 3 seconds on my laptop. That grows exponentially.
I created an issue on github: Nested clozes cause exponentially growing html · Issue #3189 · ankitects/anki · GitHub