Coloring text sometimes adds <br>

When coloring text using either the button in the editor window or the F7 key, a line break is added at the end of the field. This probably doesn’t bother most users but it messes up the layout of some of my notes. It happens either with or without add-ons loaded.
I can’t think of a reason for that being a desirable behavior.
Is there a way to turn it off?

I cannot recreate this. Could you make a screen recording of this, or inspect the HTML content of the field using the HTML editor via Ctrl-Shift-X?

I just tested it again with no add-ons loaded. Yes, it still happens. It happens on a single word field or even if there are multiple lines in the field and the text that is colored is near the beginning, there is an extra line break added at the end of the field. Of course you can’t see the line break in the field unless you open the HTML editor. But then the preview of the card will show content following the field are unexpectedly pushed to the next line.

Which Anki version are you using? If you are using anything pre 2.1.41, you should be updating.

My Anki version is 2.1.44 I haven’t updated to the latest release yet because some add-ons don’t work with it. My computer is MacOS 11.5.2 Could it be a problem with the Apple version only?
Thank you for checking it out.

Trying to find some pattern I have noticed that it doesn’t happen on the first use of the coloring button or F7 after opening a new window like a new add-note window. Only on second and following uses.

If you’d like us to look into the issue, you’ll first need to confirm it still exists in the latest version with add-ons disabled.

Yes please. Latest version, opened with shift key to stop add-ons loading, opened browser, clicked on a card, colored a part of a field, opened the html editor and there is a line break added at the end of the field.

Please reproduce it one more time, then undo the change or restore from a backup, and sync your collection to AnkiWeb. Then please let me know the card to search for to reproduce the problem.

1 Like

Have checked again on multiple cards and multiple note types, so it’s not a card problem. If you want to know the last card I tried it on the note ID is 1618185857296. First field contains: “Ho studiato così tanto ma non parlo ancora italiano.”

1 Like

Thanks for that.

@hengiesel it appears to only happen when editing an existing note

If you open an Add-Note window then click in the browser and return to the Add-Note window then it happens there too.

I’ve filed a fix for it here. Thanks for the report.

3 Likes