Skip to content

Commit

Permalink
[#708] Clean up code, fix comment, remove obvious comment
Browse files Browse the repository at this point in the history
  • Loading branch information
domoritz committed Apr 16, 2013
1 parent b564095 commit 36c6143
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions ckan/lib/helpers.py
Expand Up @@ -1384,15 +1384,17 @@ def get_request_param(parameter_name, default=None):
flags=re.UNICODE
)

# find external links eg http://foo.com, https:/bar.org/foobar.html
RE_MD_EXTERNAL_LINK = re.compile(r'(\bhttps?:\/\/[\w\-\.,@?^=%&;:\/~\\+#]*)',
# find external links eg http://foo.com, https://bar.org/foobar.html
RE_MD_EXTERNAL_LINK = re.compile(
r'(\bhttps?:\/\/[\w\-\.,@?^=%&;:\/~\\+#]*)',
flags=re.UNICODE
)

# find all tags but ignore < in the strings so that we can use it correctly
# in markdown
RE_MD_HTML_TAGS = re.compile('<[^><]*>')


def html_auto_link(data):
'''Linkifies HTML
Expand Down Expand Up @@ -1431,7 +1433,6 @@ def process(matchobj):

def render_markdown(data, auto_link=True):
''' returns the data as rendered markdown '''
# cope with data == None
if not data:
return ''
data = RE_MD_HTML_TAGS.sub('', data.strip())
Expand Down

0 comments on commit 36c6143

Please sign in to comment.