[FIX] Fixed previous commit, car go to len of the string.
bzr revid: tde@openerp.com-20131023123839-gvf9ugft2b2xmo9a
This commit is contained in:
parent
7f61d18ef9
commit
e14de7a637
|
@ -200,8 +200,8 @@ def html_email_clean(html, remove=False, shorten=False, max_length=300):
|
|||
truncate_idx = node.text.find(word) + len(word)
|
||||
else:
|
||||
truncate_idx = position
|
||||
if truncate_idx == -1 or truncate_idx >= len(node.text):
|
||||
truncate_idx = len(node.text) - 1
|
||||
if truncate_idx == -1 or truncate_idx > len(node.text):
|
||||
truncate_idx = len(node.text)
|
||||
|
||||
# compose new text bits
|
||||
innertext = node.text[0:truncate_idx]
|
||||
|
|
Loading…
Reference in New Issue