From 305de4d2bbf9526ffbf94fdcb04b9687d676095b Mon Sep 17 00:00:00 2001 From: Ross Thompson Date: Fri, 20 Nov 2015 10:07:56 -0500 Subject: [PATCH] [#2746] Simplify test for empty or missing value in markdown_extract --- ckan/lib/helpers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ckan/lib/helpers.py b/ckan/lib/helpers.py index 3c4477e7163..bf42584359c 100644 --- a/ckan/lib/helpers.py +++ b/ckan/lib/helpers.py @@ -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: