You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
whitespace is dropped if it is at the beginning or end. this is undesirable if using titlecase say as a method or plugin in a text editor such as vim. please preserve whitespace at beginning and end. I might prefer this to be the default behavior, but perhaps it makes sense to instead add this functionality as a flag like -w or --preserve-whitespace
input f g
expected F G
actual F G
or with visible spaces:
input ␣␣␣␣f␣␣g␣␣␣
expected ␣␣␣␣F␣␣G␣␣␣
actual F␣␣G
The text was updated successfully, but these errors were encountered:
kevinlawler
changed the title
preserve input whitespace from beginning and end in output
preserve input leading/trailing whitespace from beginning and end in output
Oct 15, 2024
The default is always going to be whatever way John Gruber’s code behaves. But adding a switch for this seems fine. But I made the 5-line patch to implement that and all test hell failed loose: the capitalization rules expect to be operating on whole titles, and they rely on the title being trimmed to make things simpler. And I don’t want to change that code more than absolutely necessary so as not to make it harder than unavoidable to merge with upstream changes in John Gruber’s code. So this will have to be done by way of trim-then-untrim logic. Right now I have to attend to other things but I’ll get back to it.
whitespace is dropped if it is at the beginning or end. this is undesirable if using
titlecase
say as a method or plugin in a text editor such asvim
. please preserve whitespace at beginning and end. I might prefer this to be the default behavior, but perhaps it makes sense to instead add this functionality as a flag like-w
or--preserve-whitespace
input
f g
expected
F G
actual
F G
or with visible spaces:
input
␣␣␣␣f␣␣g␣␣␣
expected
␣␣␣␣F␣␣G␣␣␣
actual
F␣␣G
The text was updated successfully, but these errors were encountered: