incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [21/28] git commit: [#2835] ticket:308 Removed unnecessary re-escaping of matches
Date Wed, 24 Apr 2013 17:16:30 GMT
[#2835] ticket:308 Removed unnecessary re-escaping of matches


Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/1bdaa1ec
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/1bdaa1ec
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/1bdaa1ec

Branch: refs/heads/db/2835
Commit: 1bdaa1ecfa4962f02168d77c4632c1732085d46a
Parents: ac9e35d
Author: Igor Bondarenko <jetmind2@gmail.com>
Authored: Tue Apr 2 11:56:19 2013 +0000
Committer: Dave Brondsema <dbrondsema@slashdotmedia.com>
Committed: Wed Apr 24 16:34:42 2013 +0000

----------------------------------------------------------------------
 Allura/allura/lib/search.py |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/1bdaa1ec/Allura/allura/lib/search.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/search.py b/Allura/allura/lib/search.py
index 97a67da..29c28b7 100644
--- a/Allura/allura/lib/search.py
+++ b/Allura/allura/lib/search.py
@@ -163,11 +163,11 @@ def search_app(q='', fq=None, app=True, **kw):
                 title = h.get_first(m, 'title')
                 text = h.get_first(m, 'text')
                 if title:
-                    title = (jinja2.escape(title)
+                    title = (jinja2.Markup(title)
                                    .replace('#ALLURA-HIGHLIGHT-START#', jinja2.Markup('<strong>'))
                                    .replace('#ALLURA-HIGHLIGHT-END#', jinja2.Markup('</strong>')))
                 if text:
-                    text = (jinja2.escape(text)
+                    text = (jinja2.Markup(text)
                                   .replace('#ALLURA-HIGHLIGHT-START#', jinja2.Markup('<strong>'))
                                   .replace('#ALLURA-HIGHLIGHT-END#', jinja2.Markup('</strong>')))
                 doc['title_match'] = title


Mime
View raw message