Prefer <br> over <div></div> in Editor #925

If your workflow depends on enumerations like this, you could use proper lists, like <ul> or <ol>. With 2.1.44, you need an add-on like Mini Format Pack, but Anki 2.1.45 introduces buttons for these:
image

With lists, your paragraphs (die Zeilen, die du nacheinander aufdecken willst), will be easily separable, as each list item is wrapped like <li>Item</li>. You can easily loop through the <li> items of a particular list like this:

for (item of document.getElementById("your-list").childNodes) { /* do that thing */ }

You can then differentiate further within an item with <br>.


I get why the old behaviour would be desirable under certain circumstances (even warned on GitHub about that when the change was made), but overall, using <br> makes for much cleaner HTML within cards.

If it’s not too difficult of a change, an option to switch to that old mode (while keeping <br> as default) would definitely be something I support, because it wouldn’t harm anyone (except the dev that has to implement it :D).

1 Like