-
Notifications
You must be signed in to change notification settings - Fork 5.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to replace line breaks in ACE ? #2869
Comments
The invisible character at the end of a code line is \n (or \r\n for windows). You can search (and replace) them with regex. |
Hi @chimmihc1 thanks for your answer and time. I tried using \n, \n\r and the combination of buttons in the top of the search & replace dialog as you can see in the screen shot link in this message to try what you say and Ace editor dones't search for the line break hidden chars... Another idea? Thanks a lot for your time! |
Hi again @chimmihc1 I found that using $ character in regular expression Ace find for all line breaks. But now my question is: what should I write in the replace box to replace a line break for example, for two line breaks or another special char? Thanks!! |
I'm having the same issue. Any news on how to do this? |
Problem still persist. Browser: chrome. Line breaks are found, but it can't be replaced. I want to replace two line breaks for one. Break lines can be found by |
I used this for strip whitespace at EOLs
|
I have the opposite of this. I have a long one liner string of text full of literal "\n" that I want to replace with whitespace. How do i do this? |
If that's so then you would actually have a new "line" for each "\n"... That's if it is already in the editor. |
Say this is my string:
But, it's a ton longer. Replacing all of the "\n"s manually isn't really a choice. |
Remember Ace is a "Text editor". You will have to break out each "\n" in your string (or file) into a separate "line"... then Insert or setValue with "that" file into Ace. In other words the way you want it to look is how you will have to bring it into Ace. Python is a good tool for working with text and text files:
Please let me know if there is an easier way to do this.. Great question! |
Good point. I can do this easily in JS. as well, with much the same concept as your code:
|
This issue has not received any attention in 1 year. If you want to keep this issue open, please leave a comment below and auto-close will be canceled. |
This issue continues in the actual version: 1.4.14 |
Found :
Not Found if
ㅤ Line 346 in 352e4a6
Line 33 in 352e4a6
|
This issue has not received any attention in 1 year. If you want to keep this issue open, please leave a comment below and auto-close will be canceled. |
This issue continues in version: 1.32.3 |
It's been a month now since this pull request. Is this issue fixed yet? Why didn't @nlujjawal finish reviewing this request and merge it yet? |
PR #5675 has been merged and released as part of Ace 1.39.0. With that version you should now be able to replace line breaks in regex mode. |
Hi!
It's very common for me to process data, arrays and another information that is in different lines, but when I'm trying to replace line breaks (at the end of a line) I dont have how to say to ACE Editor that I want to look for line breaks and replace it for another text or even for including more line breaks, for example.
I'm not talking about
<br>
or\n
... I mean the simple invisible character at the end of a code line.Is there any way to do that ? To search and replace special chars?
Thanks a lot. Regards.
The text was updated successfully, but these errors were encountered: