/loggerhead/trunk

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/loggerhead/trunk

« back to all changes in this revision

Viewing changes to loggerhead/util.py

  • Committer: Jelmer Vernooij
  • Date: 2018-10-20 13:16:15 UTC
  • mto: (491.6.1 breezy)
  • mto: This revision was merged to the branch mainline in revision 494.
  • Revision ID: jelmer@jelmer.uk-20181020131615-jc0qle6npy7an013
Use bleach rather than simpleTAL's HTMLStructureCleaner.

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
 
40
40
from breezy import urlutils
41
41
 
42
 
from simpletal.simpleTALUtils import HTMLStructureCleaner
 
42
import bleach
43
43
 
44
44
log = logging.getLogger("loggerhead.controllers")
45
45
 
278
278
            s = s.decode('iso-8859-15')
279
279
        return s
280
280
 
281
 
HSC = HTMLStructureCleaner()
282
 
 
283
281
def fixed_width(s):
284
282
    """
285
283
    expand tabs and turn spaces into "non-breaking spaces", so browsers won't
298
296
 
299
297
    s = html_escape(s).expandtabs().replace(' ', NONBREAKING_SPACE)
300
298
 
301
 
    return HSC.clean(s).replace('\n', '<br/>')
 
299
    return bleach.clean(s).replace('\n', '<br/>')
302
300
 
303
301
 
304
302
def fake_permissions(kind, executable):