provide description appropriately formatted for title attribute and info field
git-svn-id: svn://svn.cy55.de/Zope3/src/cybertools/trunk@3239 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
parent
8a37852f48
commit
1fa202c5c2
1 changed files with 10 additions and 1 deletions
|
@ -27,12 +27,21 @@ from datetime import datetime
|
|||
|
||||
|
||||
def nl2br(text):
|
||||
if not text: return text
|
||||
if not text:
|
||||
return text
|
||||
if '\n' in text: # Unix or DOS line endings
|
||||
return '<br />\n'.join(x.replace('\r', '') for x in text.split('\n'))
|
||||
else: # gracefully handle Mac line endigns
|
||||
return '<br />\n'.join(text.split('\r'))
|
||||
|
||||
def nl2pipe(text):
|
||||
if not text:
|
||||
return text
|
||||
if '\n' in text: # Unix or DOS line endings
|
||||
return ' | '.join(x.replace('\r', '') for x in text.split('\n'))
|
||||
else:
|
||||
return ' | '.join(text.split('\r'))
|
||||
|
||||
|
||||
def formatDate(dt=None, type='date', variant='medium', lang='de'):
|
||||
""" type: date, time, dateTime;
|
||||
|
|
Loading…
Add table
Reference in a new issue