<br><br/>b converts to <br><br>b<br> in field

khonkhortisan's Avatar


04 May, 2020 03:04 PM

<br><br/> with anything after it (removes the slash and) adds an extra <br> at the end, which isn't obvious when editing a field, but can show up on the card if the field isn't last in the template.

  1. 1 Posted by p4nix on 04 May, 2020 03:24 PM

    p4nix's Avatar

    Sometimes, with MathJax Anki will insert an invisible <br> too. I have troubles reproducing the behaviour though.

    EDIT: pressing ctrl+m,m to introduce a mathjax \(\) on an empty field will append an invisible <br>. This can be problematic with certain card templates.

  2. 2 Posted by addons_zz on 04 May, 2020 07:46 PM

    addons_zz's Avatar

    What Anki version you guys are using? I think there was a fix about this on the latest version 2.1.25

    1. https://apps.ankiweb.net/
    2. https://github.com/ankitects/anki-changes
    3. https://github.com/ankitects/anki-betas
  3. 3 Posted by p4nix on 04 May, 2020 07:51 PM

    p4nix's Avatar

    Can't speak for the others, but macOS: Anki 2.1.25

  4. 4 Posted by kelciour on 04 May, 2020 10:05 PM

    kelciour's Avatar

    It doesn't bother me, but maybe it's related.

    If you type or copy-paste something in the empty field, select it and remove it, the field will be empty (""), in HTML it will be displayed as <br>, and if you press Ctrl-Z to undo the changes, the field will contain extra empty new line (<br>) at the start of the field.

  5. Support Staff 5 Posted by Damien Elmes on 05 May, 2020 05:38 AM

    Damien Elmes's Avatar

    - Anki inserts a <br> when the field is empty so that the field box doesn't shrink in size.
    - The extra added <br> appears to be caused by the HTML parsing library (beautifulsoup).

  6. 6 Posted by khonkhortisan on 05 May, 2020 01:51 PM

    khonkhortisan's Avatar

    I'm on win10 Anki 2.1.25 and I can do all three
    ctrl+m, m→\(\)<br>
    asdf ctrl+a del ctrl-z→<br>asdf

Comments are closed, but you can start a new discussion.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac