-
Notifications
You must be signed in to change notification settings - Fork 13
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
Tabs are stripped #20
Comments
Hrm! Not intentionally! |
Oh, I guess I didn't dive deeply enough into how all of this works under the hood: Lines 168 to 173 in 830038d
Would you like to submit a patch? I migrated to a new PC a few months ago and don't have this repo checked out in a convenient place at the moment. |
@luser which characters exactly do we need to special case here? Only tabs? What about vertical tabs, carriage-returns, NULs, and other characters that mostly lost their meaning today? |
Actually could we just print every byte passed to |
Adding tabs to the special-case list so that it consists of just
While we could, I think that given the stated purpose of this crate it's reasonable to be judicious in what we pass through. What would probably be useful would be to document the behavior we have implemented somewhere, maybe in the top-level crate docs? Line 3 in 830038d
You don't have to write these docs if you submit a PR, I'm just writing this down while I'm thinking about it. We could link to the ANSI escape code page on Wikipedia, and describe the categories of what this library strips:
Nice catch, BTW! Thanks for taking the time to report it! |
np! Sorry for taking so long to come back to this; I mostly empathise with your concerns of introducing changes to such a widely used crate, but at the very least some characters that I think appear reasonably often are |
It seems actually that the minimal set of bytes I'd expect to come through exactly overlap with the escape sequences that Rust provides https://doc.rust-lang.org/reference/tokens.html#byte-escapes. This seems to me to indicate some universality to them, at least within the Rust ecosystem. As per |
I also did confirm that the characters we strip are exactly the range |
The tab character
\t
(U+0009 Horizontal Tabulation) gets stripped by this crate (for examplestrip_str("\t")
->""
), which is not what I expected.Is the tab character considered an ANSI escape sequence by this crate? If so the documentation should make it clearer.
The text was updated successfully, but these errors were encountered: