
- #Adding non breaking space word 2016 Patch
- #Adding non breaking space word 2016 full
- #Adding non breaking space word 2016 code

Line break ( ↵) breaks the current line without new paragraph. Im using Word 2016 to write articles that must keep certain words on the same line.Non-breaking space ( °) is a space character that prevents an automatic line break at its position.Space – each pressing of the key will be displayed as.The following symbols will be displayed: + textwrap-honor-non-breaking-spaces.To display characters on the monitor screen in Microsoft Word (Home tab) or and its derivatives (upper panel), press the icon ¶. + lemburg, vstinner, benjamin.peterson, lotti New changeset b86dacb9e668 by Serhiy Storchaka in branch 'default': New changeset bfa400108fc5 by Serhiy Storchaka in branch '3.6': Issue #20491: The textwrap.TextWrapper class now honors non-breaking spaces. New changeset fcabef0ce773 by Serhiy Storchaka in branch '3.5': I think in future we should implement the Unicode line breaking algorithm. Maybe add breaking Unicode spaces (OGHAM SPACE MARK, EN QUAD, etc) to _whitespace?
#Adding non breaking space word 2016 Patch
Proposed patch resolves conflicts and addresses Eric's comments.
#Adding non breaking space word 2016 code
The code of the textwrap module was changed since publishing the last patch. If you want to help move it forward please do a review of the patch (see ), including whether or not all outstanding review comments have been addressed, and post your recommendations here. If there's anything I can contribute to get things going again, by all means please let me know. Especially since the semantic of a non-breaking space is pretty much exactly to *not* break on text wrapping. So if nothing else, please take it as a gentle reassurance that this bug is really affecting real-world scenarios and annoying as hell. But now the last change was 2 years ago and no relief in sight. I've posted about a year ago on python-list ( ) and was referred to this bug and thought I'd wait it out. This issue is *really*, really, really annoying me. is there a reason why this has not made it into vanilla yet? If so, I'd like to try to help out clear impediments if I can. Wanted to follow up on the state of this. Patch on top of dbudinova's that attempts to replace the concatenation of strings with a verbose regex. I don’t know about the other characters listed by Serhiy, and I wouldn’t worry about them unless users requested support for them or another core dev explained why they should be supported.Ī comment at the start of the module (where _whitespace, used in the patch here, is defined) even talks about NBSP it is focused on bytes though and should be updated for the Python 3 unicode world. NON-BREAKING SPACE and NARROW NON-BREAKING SPACE are characters whose intent is clear and who are used by knowledgeable users and smart software, for example LibreOffice with an fr_FR locale. And from this side of view the proposed patch is a regression.
#Adding non breaking space word 2016 full
What about other spaces: '\N'? In Python 2 textwrap supported only 8-bit spaces, but Python 3 should support full Unicode. Using a multiline regex (with re.VERBOSE) would also avoid the clutter of parens and quotes. It looks to me that code can be a little more clear if use C-style formatting. Could you add some tests in Lib/test/test_textwrap?Īlso, for your contribution to be integrated, we'll need you to sign a contributor's agreement: Īuthor: Serhiy Storchaka (serhiy.storchaka) * In the beginning of the module, the _whitespace variable is defined to address this issue but is not used in the regular expressions determining the splitting rules. The textwrap module does not distinguish non-breaking space (\xa0) from other whitespace when determining word boundaries.

Patch with test for NARROW NO-BREAK SPACE Mariatta, benjamin.peterson, dbudinova, eric.araujo, lotti, georg.brandl, joebauer, kunkku, lemburg, loewis, maatt, mcepl, pitrou, python-dev, r.david.murray, serhiy.storchaka, vstinnerĬreated on 20:46 by kunkku, last changed 23:06 by mcepl.
