Skip to content

Conversation

@parthea
Copy link
Contributor

@parthea parthea commented Jan 20, 2022

The default behaviour of textwrap.wrap is to break text on hyphens. This PR sets the break_on_hyphens parameter of textwrap.wrap to False in order to preserve hyperlinks with hyphens.

Fixes #1131

@parthea parthea force-pushed the preserve-links-with-hyphens branch from 4dfb8aa to fff337f Compare January 20, 2022 02:11
Copy link
Contributor

@busunkim96 busunkim96 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice find! Could you add a unit test that checks a string with a hyperlink?

Copy link
Contributor

@software-dov software-dov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@parthea parthea force-pushed the preserve-links-with-hyphens branch from c4b6966 to e7f4477 Compare January 22, 2022 14:26
@parthea parthea force-pushed the preserve-links-with-hyphens branch from e7f4477 to 2947aa6 Compare January 22, 2022 14:27
@parthea
Copy link
Contributor Author

parthea commented Jan 24, 2022

@busunkim96 @software-dov Please could you review/approve?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Protobuf docstrings wrap links midway if they contain dashes

3 participants