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

**URL:** <https://forums.ankiweb.net/t/remove-linebreaks-do-word-wrap-fork-for-2-1-official-thread/160>\
**Category:** Add-ons\
**Created:** [June 14, 2020, 2:41pm UTC](https://forums.ankiweb.net/t/remove-linebreaks-do-word-wrap-fork-for-2-1-official-thread/160 "2020-06-14T14:41:38Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![ijgnd](https://avatars.discourse-cdn.com/v4/letter/i/bbe5ce/32.png) [@ijgnd](https://forums.ankiweb.net/u/ijgnd)\
**Post date:** [June 14, 2020, 2:41pm UTC](https://forums.ankiweb.net/t/remove-linebreaks-do-word-wrap-fork-for-2-1-official-thread/160/1 "2020-06-14T14:41:38Z")

</div>

If you have a problem with the add-on [remove linebreaks / do word wrap (fork for 2.1)](https://ankiweb.net/shared/info/2028179508) 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.

---

<div class="post-metadata">

**Author:** ![aPaci](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/apaci/32/1347_2.png) [@aPaci](https://forums.ankiweb.net/u/aPaci)\
**Post date:** [April 10, 2021, 11:25am UTC](https://forums.ankiweb.net/t/remove-linebreaks-do-word-wrap-fork-for-2-1-official-thread/160/2 "2021-04-10T11:25:12Z")

</div>

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)

---

<div class="post-metadata">

**Author:** ![ijgnd](https://avatars.discourse-cdn.com/v4/letter/i/bbe5ce/32.png) [@ijgnd](https://forums.ankiweb.net/u/ijgnd)\
**Post date:** [April 11, 2021, 11:45pm UTC](https://forums.ankiweb.net/t/remove-linebreaks-do-word-wrap-fork-for-2-1-official-thread/160/3 "2021-04-11T23:45:46Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![aPaci](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/apaci/32/1347_2.png) [@aPaci](https://forums.ankiweb.net/u/aPaci)\
**Post date:** [April 12, 2021, 7:45am UTC](https://forums.ankiweb.net/t/remove-linebreaks-do-word-wrap-fork-for-2-1-official-thread/160/4 "2021-04-12T07:45:14Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ijgnd](https://avatars.discourse-cdn.com/v4/letter/i/bbe5ce/32.png) [@ijgnd](https://forums.ankiweb.net/u/ijgnd)\
**Post date:** [April 12, 2021, 10:52am UTC](https://forums.ankiweb.net/t/remove-linebreaks-do-word-wrap-fork-for-2-1-official-thread/160/5 "2021-04-12T10:52:05Z")

</div>

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).

---

<div class="post-metadata">

**Author:** ![aPaci](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/apaci/32/1347_2.png) [@aPaci](https://forums.ankiweb.net/u/aPaci)\
**Post date:** [April 12, 2021, 4:44pm UTC](https://forums.ankiweb.net/t/remove-linebreaks-do-word-wrap-fork-for-2-1-official-thread/160/6 "2021-04-12T16:44:01Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![gustavosmen](https://avatars.discourse-cdn.com/v4/letter/g/b5e925/32.png) [@gustavosmen](https://forums.ankiweb.net/u/gustavosmen)\
**Post date:** [January 4, 2022, 6:49am UTC](https://forums.ankiweb.net/t/remove-linebreaks-do-word-wrap-fork-for-2-1-official-thread/160/7 "2022-01-04T06:49:44Z")

</div>

Doesn’t work on qt6 😕

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\2028179508\__init_\_.py”, line 1, in   
from . import remove\_linebreaks  
File “C:\Users\X\AppData\Roaming\Anki2\addons21\2028179508\remove\_linebreaks.py”, line 77, in   
aqt.editor.\_html = jsfunc\_remove\_breaks + aqt.editor.\_html  
AttributeError: module ‘aqt.editor’ has no attribute ‘\_html’

---

<div class="post-metadata">

**Author:** ![ijgnd](https://avatars.discourse-cdn.com/v4/letter/i/bbe5ce/32.png) [@ijgnd](https://forums.ankiweb.net/u/ijgnd)\
**Post date:** [January 5, 2022, 5:06pm UTC](https://forums.ankiweb.net/t/remove-linebreaks-do-word-wrap-fork-for-2-1-official-thread/160/8 "2022-01-05T17:06:12Z")

</div>

@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.

---

<div class="post-metadata">

**Author:** ![gustavosmen](https://avatars.discourse-cdn.com/v4/letter/g/b5e925/32.png) [@gustavosmen](https://forums.ankiweb.net/u/gustavosmen)\
**Post date:** [January 5, 2022, 5:24pm UTC](https://forums.ankiweb.net/t/remove-linebreaks-do-word-wrap-fork-for-2-1-official-thread/160/9 "2022-01-05T17:24:04Z")

</div>

I don’t know if it’s necessary, as your other add-on works as a suitable replacement.  
[https://ankiweb.net/shared/info/356095608](https://ankiweb.net/shared/info/356095608)

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

---

<div class="post-metadata">

**Author:** ![Schmitz1](https://avatars.discourse-cdn.com/v4/letter/s/2acd7d/32.png) [@Schmitz1](https://forums.ankiweb.net/u/Schmitz1)\
**Post date:** [April 2, 2022, 3:46pm UTC](https://forums.ankiweb.net/t/remove-linebreaks-do-word-wrap-fork-for-2-1-official-thread/160/10 "2022-04-02T15:46:05Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![ijgnd](https://avatars.discourse-cdn.com/v4/letter/i/bbe5ce/32.png) [@ijgnd](https://forums.ankiweb.net/u/ijgnd)\
**Post date:** [April 5, 2022, 7:20pm UTC](https://forums.ankiweb.net/t/remove-linebreaks-do-word-wrap-fork-for-2-1-official-thread/160/11 "2022-04-05T19:20:10Z")

</div>

@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](https://docs.ankiweb.net/browsing.html?highlight=replace#find-and-replace) But that would be complicated.

---

<div class="post-metadata">

**Author:** ![Schmitz1](https://avatars.discourse-cdn.com/v4/letter/s/2acd7d/32.png) [@Schmitz1](https://forums.ankiweb.net/u/Schmitz1)\
**Post date:** [April 6, 2022, 2:43pm UTC](https://forums.ankiweb.net/t/remove-linebreaks-do-word-wrap-fork-for-2-1-official-thread/160/12 "2022-04-06T14:43:26Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Yaser](https://avatars.discourse-cdn.com/v4/letter/y/8e7dd6/32.png) [@Yaser](https://forums.ankiweb.net/u/Yaser)\
**Post date:** [August 11, 2022, 4:20am UTC](https://forums.ankiweb.net/t/remove-linebreaks-do-word-wrap-fork-for-2-1-official-thread/160/13 "2022-08-11T04:20:37Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![jambamboleo](https://avatars.discourse-cdn.com/v4/letter/j/13edae/32.png) [@jambamboleo](https://forums.ankiweb.net/u/jambamboleo)\
**Post date:** [September 16, 2022, 8:03am UTC](https://forums.ankiweb.net/t/remove-linebreaks-do-word-wrap-fork-for-2-1-official-thread/160/14 "2022-09-16T08:03:48Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Saaabo](https://avatars.discourse-cdn.com/v4/letter/s/7ea924/32.png) [@Saaabo](https://forums.ankiweb.net/u/Saaabo)\
**Post date:** [August 9, 2024, 12:50pm UTC](https://forums.ankiweb.net/t/remove-linebreaks-do-word-wrap-fork-for-2-1-official-thread/160/15 "2024-08-09T12:50:55Z")

</div>

I am experiencing unexpected behavior.  
When my cursor is in a list (HTML EXAMPLE, so my point is easier to follow, but only the normal editor is used):

```auto
<ul>
<li>A</li>
<li>B</li> <- CURSOR HERE
</ul>

```

and **press remove linebreaks** a new empty list item will get added:

```auto
<ul>
<li></li> <- UNWANTED
<li>A</li>
<li>B</li>
</ul>

```

Can anybody confirm it also happens on their machine?

---

<div class="post-metadata">

**Author:** ![jambamboleo](https://avatars.discourse-cdn.com/v4/letter/j/13edae/32.png) [@jambamboleo](https://forums.ankiweb.net/u/jambamboleo)\
**Post date:** [August 9, 2024, 1:55pm UTC](https://forums.ankiweb.net/t/remove-linebreaks-do-word-wrap-fork-for-2-1-official-thread/160/16 "2024-08-09T13:55:39Z")

</div>

I followed your instruction and can confirm that the same happens here.

---

<div class="post-metadata">

**Author:** ![Saaabo](https://avatars.discourse-cdn.com/v4/letter/s/7ea924/32.png) [@Saaabo](https://forums.ankiweb.net/u/Saaabo)\
**Post date:** [August 12, 2024, 7:42am UTC](https://forums.ankiweb.net/t/remove-linebreaks-do-word-wrap-fork-for-2-1-official-thread/160/17 "2024-08-12T07:42:23Z")

</div>

I would love to see this fixed @ijgnd

---

<div class="post-metadata">

**Author:** ![ijgnd](https://avatars.discourse-cdn.com/v4/letter/i/bbe5ce/32.png) [@ijgnd](https://forums.ankiweb.net/u/ijgnd)\
**Post date:** [August 12, 2024, 10:42am UTC](https://forums.ankiweb.net/t/remove-linebreaks-do-word-wrap-fork-for-2-1-official-thread/160/18 "2024-08-12T10:42:20Z")

</div>

thanks for this clear bug report and the verification. I will look into it. but unfortunately no timeline due to a lack of time.

---

<div class="post-metadata">

**Author:** ![Saaabo](https://avatars.discourse-cdn.com/v4/letter/s/7ea924/32.png) [@Saaabo](https://forums.ankiweb.net/u/Saaabo)\
**Post date:** [September 18, 2024, 11:28am UTC](https://forums.ankiweb.net/t/remove-linebreaks-do-word-wrap-fork-for-2-1-official-thread/160/19 "2024-09-18T11:28:05Z")

</div>

Sorry for asking again. But is there any progress so far? It has been over a month.

---

<div class="post-metadata">

**Author:** ![ijgnd](https://avatars.discourse-cdn.com/v4/letter/i/bbe5ce/32.png) [@ijgnd](https://forums.ankiweb.net/u/ijgnd)\
**Post date:** [September 23, 2024, 6:59pm UTC](https://forums.ankiweb.net/t/remove-linebreaks-do-word-wrap-fork-for-2-1-official-thread/160/20 "2024-09-23T18:59:40Z")

</div>

Unfortunately I’m still pretty busy. So I guess the timeline is a couple of months or maybe there won’t be a fix at all. I’d prefer to give you a different answer but there’s also my regular life … If someone else posts a fix I’m happy to merge it …
