mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2024-11-26 04:48:09 -06:00
Fixed error when displaying URL'S in multiline tweets. Fixes #305
This commit is contained in:
parent
0f2662e52d
commit
bca6861bcb
@ -2,6 +2,10 @@
|
||||
|
||||
## changes in this version
|
||||
|
||||
* Fixed error when displaying an URL at the end of a line, when the tweet or direct message contained multiple lines. Now the URL should be displayed correctly. ((#305,)[https://github.com/manuelcortez/TWBlue/issues/305])
|
||||
|
||||
## Changes in version 0.95
|
||||
|
||||
* TWBlue can open a Tweet or user directly in Twitter. There is a new option in the context menu for people and tweet buffers, and also, the shortcut control+win+alt+Enter will open the focused item in Twitter.
|
||||
* Some keystrokes were remapped in the Windows 10 Keymap:
|
||||
* Read location of a tweet: Ctrl+Win+G. ([#177](https://github.com/manuelcortez/TWBlue/pull/177))
|
||||
|
@ -19,11 +19,11 @@ __doc__ = "Find urls in tweets and #audio hashtag."
|
||||
|
||||
url_re = re.compile(r"(?i)\b((?:https?://|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'\".,<>?«»“”‘’]))")
|
||||
|
||||
url_re2 = re.compile("(?:\w+://|www\.)[^ ,.?!#%=+][^ ]*")
|
||||
bad_chars = '\'\\.,[](){}:;"'
|
||||
url_re2 = re.compile("(?:\w+://|www\.)[^ ,.?!#%=+][^ \\n\\t]*")
|
||||
bad_chars = '\'\\\n.,[](){}:;"'
|
||||
|
||||
def find_urls_in_text(text):
|
||||
return [s.strip(bad_chars) for s in url_re2.findall(text)]
|
||||
return url_re2.findall(text)
|
||||
|
||||
def find_urls (tweet):
|
||||
urls = []
|
||||
|
Loading…
Reference in New Issue
Block a user