-
-
Notifications
You must be signed in to change notification settings - Fork 33.6k
gh-74865: textwrap support for true (Unicode) em-dashes #2224
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
base: main
Are you sure you want to change the base?
Conversation
|
Unfortunately this PR has languished for a long time. Sorry for that! Linking back to the issue explicitly: https://bugs.python.org/issue30680 I'm willing to help see this PR through to completion, if there's still interest in it. I haven't looked closely yet, but:
Also going to close and reopen to retrigger CI. |
|
This PR is stale because it has been open for 30 days with no activity. |
|
This PR is stale because it has been open for 30 days with no activity. |
|
This PR is stale because it has been open for 30 days with no activity. |
|
Why em-dash is special than any other Unicode special characters? |
|
This PR is stale because it has been open for 30 days with no activity. |
textwrapspecifically recognizes and specially treats the ASCII simulation of an em-dash (two or more consecutive hyphens). It does nothing, however, to recognize and treat true em-dashes (aka'\N{EM DASH}','\u2014', or U+2014). Real em-dashes should get at least as good a treatment as simulated em-dashes.This PR adds parallel treatment, plus tests.
(Some tests for "degenerate" cases of the simulated em-dash, e.g. three or more consecutive hyphens, are not replicated for the true em-dash, because repeating the true em-dash has no common sensible meaning.)
https://bugs.python.org/issue30680