Anki 25.09.4 (d52ca669)
Python 3.13.5 Qt 6.9.1 PyQt 6.9.1
Platform: macOS-26.5.1-arm64-arm-64bit-Mach-O
Hi, thanks for the development of Anki. I would like to report three duplication bugs that I notice, all related to unordered/ordered lists used in the editor. Here are the reproducing steps for each bug:
I. Undo duplication
(1) Write into the editor “line”.
(2) In the non html editor, select this line, then press the unordered/ordered list button in the tool bar (or use keyword shortcut); the html field of the editor becomes
<ol><li>line</li></ol>
(3) Press the undo shortcut (command + Z on Mac)
Result: the list is still there, but its content is duplicated after the list; the html field reads:
<ol><li>line</li></ol>line
Remark: the same bug occurs when we begin with multiple lines instead of just one.
II. Duplication caused by a cross line styling tag
(1) Write into the editor so that the html field becomes
line1 italic1<br>italic2 line2
(2) In the non html editor, put “italic1” into italic (using keyboard shortcut or tool bar button), then put “italic2” into italic too. Now the html field becomes
line1 <i>italic1<br>italic2</i> line2
Notice that the editor aggressively fusions the two <i></i> fields into one, with the <br>tag inside it; this leads to the following bug when we make the lines into a list.
(3) Select both lines in the non html editor, then make them into an ordered or unordered list (toolbar button / keyboard shortcut).
Result: the “italic2” is duplicated in the end of the first line; the html field reads:
<ul><li>line1 <i>italic1<br>italic2</i></li><li><i>italic2</i> line2</li></ul>
Remark: the same bug occurs for bold and underline too, not just italic.
III. Duplication of styling tags due to two different types of list
(1) Write two lines so that the html field reads
line1<br>bold line2
(2) Make the first line into an unordered list (button/keyboard), and make “bold” bold; the html field now reads
<ul><li>line1</li></ul><b>bold</b> line2<br>
Notice that the <br> tag between the lines is put to the end by the editor, which leads to the following bug.
(3) Make the second line into an ordered list (button/keyboard).
Result: a new <b></b> is created by the editor and envelops the whole second list; the html field reads
<ul><li>line1</li></ul><b><ol><li><b>bold</b> line2</li></ol></b>
Remark: the steps can vary and still produce the same bug of duplicating styling tags. The important things are: (1) there is no <br>between the end of the first list and the styling tag at the beginning of the elements which are to be made into a second list (hence the html contains something like </ul><b> or </ol><b>); (2) the second list is of different type from the first list (otherwise the editor will fusion these two lists). The same bug also occurs with other styling tags (underline, italic, etc.).