Remove linebreaks / do word wrap (fork for 2.1) [Official thread]

If you have a problem with the add-on remove linebreaks / do word wrap (fork for 2.1) post in this thread. This way I get notified. If you make a new thread I will likely miss it. If you post your comment, question or bug report on ankiweb as a review I won’t get notified. You really should post in this thread.

1 Like

Doesn’t work with anki 2.1.43 (and also 2.1.42 i think?). When i press ctrl+d it just delete the text (it doesn’t give any error though)

it actually broke with .41. I’m still on older versions so if you find a broken add-on let me know. I just uploaded a small update which should make it work again on the latest versions. Could you test it and let me know if it works.

Thank you very much! Now it works if i manually press the button, but it does nothing with the shortcut alt+D…

The default shortcut is working for me. Have you tried another shortcut. Your custom shortcut “Alt+D” maybe conflicts with another add-on. “Alt+D” is easy to press and should be “popular”, e.g. my “Cut/Copy from Editor …” uses this by default (iirc).

I changed it to alt+r and now it works! Thank you very much!

Doesn’t work on qt6 :confused:

When loading ‘⁨remove linebreaks do word wrap⁩’:
⁨Traceback (most recent call last):
File “aqt.addons”, line 239, in loadAddons
File “C:\Users\X\AppData\Roaming\Anki2\addons21\”, line 1, in
from . import remove_linebreaks
File “C:\Users\X\AppData\Roaming\Anki2\addons21\2028179508\”, line 77, in
aqt.editor._html = jsfunc_remove_breaks + aqt.editor._html
AttributeError: module ‘aqt.editor’ has no attribute ‘_html’

@gustavosmen : should be broken due to changes in the editor in all qt versions … it’ll take some time until i have a new version.

1 Like

I don’t know if it’s necessary, as your other add-on works as a suitable replacement.

Anyway, thank you for your awesome work, as ever.

1 Like

Hello. Thanks for this addon, its very useful. Man, I want to know if is possible select all my cards and apply this command to all them. Thank you.

@Schmitz1: My add-on does not support it. I added it to the bottom of my todo list so I’ll possibly never find the time.

maybe the built-in find and replace functionality could help, Browsing - Anki Manual But that would be complicated.

No problem!! Its very useful anyway. Thank your for answer.

Hi man
I really wanted wanted to thank you about the add on but can you please update the add on since it is really essential for many of us.

Just as a(nother) workaround for y’all, you can do the same in a text editor like Notepad++.

  1. New document
  2. Paste your text.
  3. Hit Ctrl+H to open the Replace window.
  4. Set Search mode to Extended
  5. Find what: -\r\n
  6. Make sure the Replace with: field is completely empty
  7. Hit Replace All
  8. Find what: \r\n
  9. Make sure the Replace with: field contains one single space character and nothing else
  10. Hit Replace All
  11. Copy+paste the result into Anki.
1 Like