Skip to content
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

No way to specify multiple escape characters #8

Open
haltman-at opened this issue Feb 1, 2023 · 3 comments
Open

No way to specify multiple escape characters #8

haltman-at opened this issue Feb 1, 2023 · 3 comments
Labels
enhancement New feature or request question Further information is requested

Comments

@haltman-at
Copy link

haltman-at commented Feb 1, 2023

For some uses, it might be nice to be able to specify multiple characters any of which can act as an escape. Right now you can only have one escape character, as best I can tell; if you pass a multi-character string as the escape character, the result is that you won't be able to escape at all.

Thanks!

@ljharb
Copy link
Owner

ljharb commented Feb 1, 2023

What form would you expect?

I can imagine a regular expression or a predicate function, but those could have unpredictable results - a simpler option is to accept an array of multiple strings, but that would break anyone who'd been passing in an array of a single character. However, I'd hope nobody is doing this.

@ljharb ljharb added enhancement New feature or request question Further information is requested labels Feb 1, 2023
@haltman-at
Copy link
Author

Accepting multiple characters as a single string is also a possibility -- a character is an escape if it appears in the string.

@ljharb
Copy link
Owner

ljharb commented Feb 1, 2023

true. altho it's probably more likely that someone is using a multi-char escape sequence than that they're passing an array containing one item

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants