Skip to content

Commit

Permalink
Protect against blank titles causing a stack traceback
Browse files Browse the repository at this point in the history
  • Loading branch information
rubys committed Aug 15, 2010
1 parent 206b21e commit 4aa9087
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion filters/mememe.plugin
Expand Up @@ -419,7 +419,7 @@ for i in range(0,len(weighted_links)):
title = re.sub('&#x(\w+);',lambda n: unichr(int(n.group(1),16)), title)

# title too long? Insert zero width spaces where appropriate
if max(map(len,title.split())) > 30:
if len(title.strip())>0 and max(map(len,title.split())) > 30:
title=re.sub('(\W+)',u'\\1\u200b',title)

# save the entry title (it is used later)
Expand Down

0 comments on commit 4aa9087

Please sign in to comment.