Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editor: divs with attributes are not deleted #3766

Open
jcznk opened this issue Jan 24, 2025 · 3 comments
Open

Editor: divs with attributes are not deleted #3766

jcznk opened this issue Jan 24, 2025 · 3 comments
Labels

Comments

@jcznk
Copy link

jcznk commented Jan 24, 2025

I’m testing on Anki 25.01 beta 1, Windows 11. I recall this issue occurring in previous versions as well.

If the entire content of a field is wrapped in a <div> with one or more attributes, deleting the field's content (without using the HTML editor) leaves the <div> intact.

For example, if the field content is: <div class="myClass">foo</div>, deleting it results in <div class="myClass"></div>.

This behavior also occurs when such a <div> is nested within other tags, such as <span><b><div class="myClass">foo</div></b></span>. After deleting the field content, it becomes <span><b><div class="myClass"></div></b></span>.

However, the issue does not occur if there is any content outside the <div>. For example, when testing with this HTML: abc<div class="myClass">foo</div>, the problem does not happen.

@abdnh abdnh added the editor label Jan 25, 2025
@abdnh
Copy link
Collaborator

abdnh commented Jan 25, 2025

The content is replaced with <br> according to my tests

@jcznk
Copy link
Author

jcznk commented Jan 25, 2025

Ah, you're right—it's the same on my computer. Thanks!

@dae dae closed this as completed Jan 26, 2025
@abdnh
Copy link
Collaborator

abdnh commented Jan 31, 2025

I assume this was closed accidentally @dae

@abdnh abdnh reopened this Jan 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants