Skip to content

Commit 0de01a4

Browse files
committed
Fix indentation and disable url shortening when max_url_length is set to -1.
1 parent 9d4157a commit 0de01a4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ttp.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
URL_REGEX = re.compile('((%s)((https?://|www\\.)(%s)(\/%s*%s?)?(\?%s*%s)?))'
5959
% (PRE_CHARS, DOMAIN_CHARS, PATH_CHARS,
6060
PATH_ENDING_CHARS, QUERY_CHARS, QUERY_ENDING_CHARS),
61-
re.IGNORECASE)
61+
re.IGNORECASE)
6262

6363

6464
# Registered IANA one letter domains
@@ -227,7 +227,7 @@ def _parse_tags(self, match):
227227
def _shorten_url(self, text):
228228
'''Shorten a URL and make sure to not cut of html entities.'''
229229

230-
if len(text) > self._max_url_length:
230+
if len(text) > self._max_url_length and self._max_url_length != -1:
231231
text = text[0:self._max_url_length - 3]
232232
amp = text.rfind('&')
233233
close = text.rfind(';')

0 commit comments

Comments
 (0)