-
-
Notifications
You must be signed in to change notification settings - Fork 30.8k
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
Fix line breaks added after hyphenations by blurb. #7002
Fix line breaks added after hyphenations by blurb. #7002
Conversation
@terryjreedy, please take a look at IDLE entries. Seems there are issues with a bullet list. |
I just removed the asterisks and it looks OK to me. |
I gather that when blurb was introduced, the existing 3.5 and 3.6 news entries were split apart into individual files and then reassembled by blurb. In the process, it re-flowed the text, I presume with textwrap, sometimes putting newlines after hyphens. Why you think this is a problem? It is standard practice in English text composition and sometimes, new hyphens are introduced between syllables. (Textwrap is not sophisticated enough to do that.) When Sphinx collects the x.y .rst news files into an x.y changelog, it will rewrap again, changing the locations of newlines, but again occasionally putting them after a hyphen, before justifying with whitespace. See https://docs.python.org/3/whatsnew/changelog.html#changelog for example. The question is whether having newlines follow - in .rst files affects the Sphinx reflow process. Does Sphinx treat line-ending -s as optional sofe -s, eligible to be deleted along with \n? From my cursory reading I did not see any obvious examples of this. In other words, I think this needed an issue and discussion as to whether to make such a change, and if so, why. |
I gather that when blurb was introduced, the existing 3.5 and 3.6 news entries were split apart into individual files and then reassembled by blurb. In the process, it re-flowed the text, I presume with textwrap, sometimes putting newlines after hyphens. Why you think this is a problem? It is standard practice in English text composition and sometimes, new hyphens are introduced between syllables. (Textwrap is not sophisticated enough to do that.) When Sphinx collects the x.y .rst news files into an x.y changelog, it will rewrap again, changing the locations of newlines, but again occasionally putting them after a hyphen, before justifying with whitespace. See https://docs.python.org/3/whatsnew/changelog.html#changelog for example. The question is whether having newlines follow - in .rst files affects the Sphinx reflow process. Does Sphinx treat line-ending -s as optional sofe -s, eligible to be deleted along with \n? From my cursory reading I did not see any obvious examples of this. In other words, I think this needed an issue and discussion as to whether to make such a change, and if so, why. PS. The IDLE entries could stand being changed anyway, but that can be done separately and later. An alternative to deleting the *s would be to convert them to the .rst markup. There may be other entries that need change. |
Thank you for fixing IDLE entries Terry. Yes, the problem is that this affects the Sphinx reflow process. For example, look at the entry edited by you: I think |
Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.6, 3.7. |
Sorry, @serhiy-storchaka, I could not cleanly backport this to |
Sorry, @serhiy-storchaka, I could not cleanly backport this to |
'Sphinx- like' is definitely a bug. The problem is an incompatibility between the default options of Textwrap for double reflows and a bug in its usage by blurb.
To avoid the problem in the future, blurb should pass |
This will not help because lines already were broken on hyphens. |
If people, including me, were breaking on hyphens when writing blurbs, they should not at Textwrap is currently written. It seems to me that in text, replace_whitespace should replace '-\n' with '-' rather than '- '. |
Also remove bullet asterisks from IDLE entries.. (cherry picked from commit aef639f) Co-authored-by: Serhiy Storchaka <[email protected]>
GH-7050 is a backport of this pull request to the 3.7 branch. |
Also remove bullet asterisks from IDLE entries.. (cherry picked from commit aef639f) Co-authored-by: Serhiy Storchaka <[email protected]>
GH-7051 is a backport of this pull request to the 3.6 branch. |
No description provided.