Formatted replies to wrap and have a hanging indent #89

Merged
cmccabe merged 1 commits from wrap_replies into master 2020-05-14 02:20:09 +00:00
Collaborator

Fixes #87 (first go around)

This PR is to introduce simple word wrapping to replies. It gets the current terminal width, then wraps replies to that width with a hanging indent. Here's an example:

Title    : Title
Link     : URL
Category : category
User     : username
Date     : Mon Apr 20 12:28:00 2020

Replies:

  2020-04-20 12:33 username: some text that will
                     wrap.
  2020-04-20 12:33 username222: this won't wrap       
  2020-04-20 12:33 username3: ok this one will
                     wrap.

Wrapping does not support escape characters that we use for formatting text. As a result, the username is no longer in bold. It's possible this could be addressed at a later date.

Doing this highlights some other areas for improvement, but want to keep some momentum. So, no tests for this, however I have tested against python 3.8 and found no issues.

Fixes #87 (first go around) This PR is to introduce simple word wrapping to replies. It gets the current terminal width, then wraps replies to that width with a hanging indent. Here's an example: ```shell Title : Title Link : URL Category : category User : username Date : Mon Apr 20 12:28:00 2020 Replies: 2020-04-20 12:33 username: some text that will wrap. 2020-04-20 12:33 username222: this won't wrap 2020-04-20 12:33 username3: ok this one will wrap. ``` Wrapping does not support escape characters that we use for formatting text. As a result, the username is no longer in bold. It's possible this could be addressed at a later date. Doing this highlights some other areas for improvement, but want to keep some momentum. So, no tests for this, however I have tested against python 3.8 and found no issues.
cmccabe closed this pull request 2020-05-14 02:20:09 +00:00
asdf deleted branch wrap_replies 2020-05-14 04:06:50 +00:00
sloum approved these changes 2020-05-14 06:07:07 +00:00
sloum left a comment
Collaborator

Looks good! Thanks for taking this one on :)

Looks good! Thanks for taking this one on :)
Sign in to join this conversation.
No description provided.