newlines
This commit is contained in:
parent
80722c0aca
commit
887f09464b
1 changed files with 4 additions and 4 deletions
|
@ -70,9 +70,9 @@ def html_parser(text):
|
|||
text = re.sub('\[(/.+?) (.+?)\]', '<a href="\\1">\\2</a>', text)
|
||||
|
||||
text = text.replace('__LINK__', 'http').replace('__DOT__', '.')
|
||||
text = text.replace("\n\n", '</p><p>\n')
|
||||
text = text.replace("\n", '<br>\n').replace('</p><p><br>\n', '</p><p>\n')
|
||||
text = u'<p>%s</p>'%text
|
||||
|
||||
text = text.replace('\n\n', '<br>\n').replace("\n", '<br>\n')
|
||||
|
||||
return text
|
||||
|
||||
|
||||
|
@ -158,7 +158,7 @@ def import_layers(item, layers):
|
|||
annotation.end = float(layer['time_out'])/1000
|
||||
username = layer['creator'].strip()
|
||||
annotation.user = User.objects.get(username=username)
|
||||
annotation.value = html_parser(layer['value'], False)
|
||||
annotation.value = html_parser(layer['value'])
|
||||
annotation.created = datetime.fromtimestamp(int(layer['created']))
|
||||
annotation.modified = datetime.fromtimestamp(int(layer['modified']))
|
||||
annotation.save()
|
||||
|
|
Loading…
Reference in a new issue