-
Notifications
You must be signed in to change notification settings - Fork 238
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
stringx indent and dedent functions add an extra "\n" at the end of the string #446
Comments
I tend to agree that the extra newline is weird. But is has been in here for 13 years. So not easy to fix, since it is breaking. Maybe we should label this as something to fix in a next major version. |
This equally applies to |
With a second look at the code, I can see that there are even more of the stringx functions returning an extra
Agree. I think it should be
Hm, I think it should, yes. It would be I would let the caller have the responsibility to trim the end of the string before calling |
Hello,
The indent and dedent functions both add a final "\n" sequence at the end of the string.
Code reference of the indent function:
Penlight/lua/pl/stringx.lua
Lines 500 to 514 in b101290
I think this extra "\n" sequence shouldn't be here. It's not part of the functions documentations and is (at least in my use case) unwanted.
The text was updated successfully, but these errors were encountered: