Skip to content

Commit

Permalink
[#2746] Simplify test for empty or missing value in markdown_extract
Browse files Browse the repository at this point in the history
  • Loading branch information
Ross Thompson authored and wardi committed Jan 10, 2016
1 parent 1de6582 commit bf3437e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ckan/lib/helpers.py
Expand Up @@ -793,7 +793,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 bf3437e

Please sign in to comment.