Closed SamVerschueren closed 7 years ago
Found a way to have it like this
But the solution is really dirty IMO so I want to explore other options first. But to be sure, is this what it should look like?
Note, it is a highlighted screenshot to show the start and end of the ANSI escape codes. This is the real output.
I came a bit further in solving this with PR #19.
Thank you. Nice pull request! I was about to write my own word-wrapper until saw this.
I came a bit further in solving this with PR https://github.com/chalk/wrap-ansi/pull/19.
Now that #19 is merged, is this PR still up to date?
I think it is. But let me verify when I'm on my computer. It's been a while since the PR :).
Still have some additional work for this as the current solution does not make the cut at the correct position. It should look like this right?
Then I can adjust the test and do the additional work.
It should look like this right?
Yes
Fixed it with the last commit. I believe this should do it.
@SamVerschueren Sorry, you have a merge conflict after #20.
No problem, should be fixed now.
Awesome! Hopefully we can finally get log-update
fixed now :)
Let me check that :).
This PR tries to solve issue #9 where
wrap-ansi
removes leading and trailing whitespace by default.Although the tests succeed, and
log-update
works again as expected, I don't think it's really the expected output that we get in the tests.When I highlight the output, this is what I see
I don't think I should have those extra whitespace character (1 in green, 1 in red). I believe they should be added to the next line instead. So I will have a look at how I can solve that.
But please, feedback is more than appreciated! For instance, should we have extend the
trim
option to also acceptleading
,trailing
so that users can choose to only remove trailing or only remove leading whitespaces?log-update
for instance should have enough by only trimming the trailing whitespace.// @SBoudrias @sindresorhus @Qix- @bcoe