Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Nested clozes cause exponentially growing html #3189

@naipofo

Description

@naipofo

Nested clozes generate some weird html, cause they render the inner cloze and then escape it to put in the data-cloze attribute. This results in weird html in attribute:

<span class="cloze" data-cloze="<span class=&quot;cloze&quot; data-cloze=&quot;&quot; data-ordinal=&quot;1&quot;>[...]</span>" data-ordinal="1">[...]</span>

and that html contains nested html escapes that grow exponentially. This huge html chunk slowes down extract_av_tags to a crawl and crashes anki.

This starts to cause crashes with ~11 nested clozes. Some shared decks on ankiweb have those and a user might make them by mistake, so there should be some kind of safeguard.

Originally reported on https://forums.ankiweb.net/t/memory-leak-when-search-specific-kanji-japanese-hieroglyph/44394/2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions