Delet the Enter-key with find and replace

I am looking for a way to replace the enter keys with the find and replace option.
I do not mean the element <br> or any other.
I mean the enter keys which show up in the HTML view as line breaks without code.

My computer can’t recognize them but Ankidroid on smartphone recognizes them as line breaks.
This means that not only is my line separated by a <br> but since there is a real Enter and a <br> in the HTML code, there are two line breaks.

There are too many enters in the texts to delete them individually.
But I need a continuous text without line breaks in which only <br> is contained.

Thanks a lot

I assume you used HTML tags. Please wrap them in backticks to make your post legible. Like so:

`<br>`
1 Like

I guess you mean EOL (End of Line) or LF (Line Feed) or NL (New Line) characters and not the <br> tag.

That would probably either be

1 Like

Unfortunately, newline characters (which are what you call “Enter keys” as @kleinerpirat has explained) aren’t handled consistently in Anki, so getting rid of them and only keeping HTML newlines is a good idea.
I think every newline is represented as \n internally, so matching \n with the regular expressions option enabled should be enough to find any newline, regardless of your OS and which charcters were originally entered.

3 Likes

Unfortunately, the program did not recognize \n.
But I have found another solution.

If you use find and replace you can’t set an enter key without the action being recognized as starting the find and replace function.
But you can copy an invisible line break in the HTML window and paste it with Ctrl + V.

This way I could remove all line breaks or replace them with another command.

Thanks a lot.

You probably didn’t tick the Regex option, but I’m glad you could sort it out. :slightly_smiling_face:

1 Like