Skip to content

Commit

Permalink
Allow link annotation URL property to be None.
Browse files Browse the repository at this point in the history
If the property is None, the href attribute is not added. If the property is an empty string, it is included.
  • Loading branch information
Alec Perkins committed Sep 25, 2013
1 parent c3e3e99 commit baa5c5b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion content/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ def toHTML(self, external_links=False):
markup = NOAT(self.content)
for anno in self.annotations:
a = copy.deepcopy(anno)
if 'url' in a:
if 'url' in a and a['url'] is not None:
a['href'] = a.pop('url').replace('"','"').replace('\n',' ')
if len(a['href'].split('://')) > 1 and external_links:
a['target'] = '_blank'
Expand Down

0 comments on commit baa5c5b

Please sign in to comment.