From a6abeef6a5a734ad28178f939560dd127c363544 Mon Sep 17 00:00:00 2001 From: Rob Hudson Date: Sat, 20 Sep 2008 17:09:16 -0700 Subject: Patch from Alex Gaynor that fixes jQuery conflicts with Pinax and potentially other projects. --- debug_toolbar/middleware.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'debug_toolbar/middleware.py') diff --git a/debug_toolbar/middleware.py b/debug_toolbar/middleware.py index 9170398..9c8581c 100644 --- a/debug_toolbar/middleware.py +++ b/debug_toolbar/middleware.py @@ -10,7 +10,8 @@ from debug_toolbar.toolbar.loader import DebugToolbar _HTML_TYPES = ('text/html', 'application/xhtml+xml') _END_HEAD_RE = re.compile(r'', re.IGNORECASE) -_END_BODY_RE = re.compile(r'', re.IGNORECASE) +_START_BODY_RE = re.compile(r'', re.IGNORECASE) +_END_BODY_RE = re.compile(r'', re.IGNORECASE) class DebugToolbarMiddleware(object): """ @@ -54,5 +55,6 @@ class DebugToolbarMiddleware(object): if response['Content-Type'].split(';')[0] in _HTML_TYPES: # Saving this here in case we ever need to inject into #response.content = _END_HEAD_RE.sub(smart_str(self.debug_toolbar.render_styles() + "%s" % match.group()), response.content) - response.content = _END_BODY_RE.sub(smart_str('' + self.debug_toolbar.render_toolbar()), response.content) + response.content = _START_BODY_RE.sub(smart_str('' + self.debug_toolbar.render_toolbar()), response.content) + response.content = _END_BODY_RE.sub(smart_str(''), response.content) return response -- cgit v1.2.3