Word wrap
jcubic opened this issue · 4 comments
I use you library as demo for jQuery Terminal and it seems that it don't wrap word properly,
type this:
echo There is in the worst of fortunes the best change of a happy ending. | say
the output is:
__________________________________________
/ There is in the worst of fortunes the be \
\ st change of a happy ending. /
------------------------------------------
\ ^__^
\ (oO)\_______
(__)\ )\/\
||----w |
|| ||
but native cowsay prints:
_______________________________________
/ There is in the worst of fortunes the \
\ best change of a happy ending. /
---------------------------------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
As you can see best is never broken into two words. If you will accept PR I can check if I can fix this.
It's been almost a year and no even a single comment. Do you accept PR?
@jcubic - did you every make a fix for this? It also seems to mess up due to string-width library not detecting ANSI codes. (Which it can when set).
No, I was not even checking the code.
@jcubic - fair enough. If you ever take a jab at this do lmk.
ps; I made a pr on the lolcat module you published. Would love to work with you on something / together in future. As my library is heavily inspired by yours in my organization. ie; Termino.js