Skip to content

Commit

Permalink
Merge pull request #2747 from thriuin/master
Browse files Browse the repository at this point in the history
[#2746] Simplify test for empty or missing value in markdown_extract
  • Loading branch information
wardi committed Nov 24, 2015
2 parents dc112ef + 305de4d commit 98f350a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ckan/lib/helpers.py
Expand Up @@ -866,7 +866,7 @@ def markdown_extract(text, extract_length=190):
''' return the plain text representation of markdown encoded text. That
is the texted without any html tags. If extract_length is 0 then it
will not be truncated.'''
if (text is None) or (text.strip() == ''):
if not text:
return ''
plain = RE_MD_HTML_TAGS.sub('', markdown(text))
if not extract_length or len(plain) < extract_length:
Expand Down

0 comments on commit 98f350a

Please sign in to comment.