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
✨ (Optionally) disable escaping for printable UTF-8 characters #232
Comments
Hi @liskin, Sorry for being a bit late. I really like your idea. Whether it should be optional or default behavior, I'm not sure though. I have no idea how many people we will break if we make the new behavior the default. Still, I feel like your suggested version is the nicer default in a lot of cases. So, I would be willing to make it the default and have the old behavior as optional if we indicate the potential breaking changes in the changelog with a how-to fix (e.g., by adding a .pryskrc with the appropriate setting). Last but not least, are you up for implementing the feature? best |
Sure, that was my intention from the start. I've been dealing with some personal issues lately so went silent for a bit (was avoiding computers tbh) but it's still in my TODO and I'm somewhat optimistic I'll get to it in the near future. |
Hi @liskin, Thanks for the update 👍 . best |
One of my usecases for cram/prysk is making sure my READMEs are up to date. Some of those READMEs, however, contain example output with printable Unicode characters that aren't in 7-bit ASCII. I need those examples to be human-readable, and prysk's escaping messes that up. The old escaping behaviour is still available with the `--escape7bit` command-line option. Fixes: prysk#232
One of my usecases for cram/prysk is making sure my READMEs are up to date. Some of those READMEs, however, contain example output with printable Unicode characters that aren't in 7-bit ASCII. I need those examples to be human-readable, and prysk's escaping messes that up. The old escaping behaviour is still available with the `--escape7bit` command-line option. Fixes: #232
Summary
prysk currently escapes any lines that aren't printable ASCII. I'd love to have an option to leave valid printable UTF-8 unescaped.
Details
Background & Context
As I mentioned in #224, I've been using cram for years to make sure the examples in my README.md files are up to date. Some of those READMEs, however, contain example output with printable Unicode characters that aren't in 7-bit ASCII. I need those examples to be human-readable, and prysk's escaping messes that up.
Examples
An example of this is here: https://github.com/liskin/arbtt-chart/blob/7fd576e158dd616a40de25fe9ff6cb0125899ea4/README.md#custom-inputs
So far, I've been monkey patching cram/prysk to disable escaping completely:
https://github.com/liskin/cookiecutter-python-cli/blob/ac88c73b006b686802b3c314b9a79b090929a4f1/%7B%7Bcookiecutter._dest_dir%7D%7D/tests/prysk-noescape.py#L7
https://github.com/liskin/cookiecutter-python-cli/blob/f120b1c23cb6eb5fc350109272c4b809220699f2/%7B%7Bcookiecutter._dest_dir%7D%7D/tests/cram-noescape.py#L7
This, however, requires version-pinning the prysk dependency to make sure this doesn't break, and thus incurrs additional maintenance costs.
References
Task(s)
The text was updated successfully, but these errors were encountered: