changeset 1469:af6c7a0fcd27

Backed out changeset 6dfca61f2672122ce12804ae42b90278df5c8473
author Franz Pletz <fpletz AT franz-pletz DOT org>
date Wed, 23 Aug 2006 20:40:55 +0200
parents 6dfca61f2672
children 9d82a1c73131
files MoinMoin/search/queryparser.py MoinMoin/search/results.py
diffstat 2 files changed, 5 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/search/queryparser.py	Wed Aug 23 03:07:56 2006 +0200
+++ b/MoinMoin/search/queryparser.py	Wed Aug 23 20:40:55 2006 +0200
@@ -269,10 +269,7 @@
         return u'%s"%s"' % (neg, unicode(self._pattern))
 
     def highlight_re(self):
-        # XXX Why can there be a )?
-        pattern = self._pattern[-1] != ')' and self.pattern or \
-                self._pattern[:-1]
-        return u"(%s)" % pattern
+        return u"(%s)" % self._pattern
 
     def search(self, page):
         matches = []
@@ -384,10 +381,7 @@
         return u'%s!"%s"' % (neg, unicode(self._pattern))
 
     def highlight_re(self):
-        # XXX Why can there be a )?
-        pattern = self._pattern[-1] != ')' and self.pattern or \
-                self._pattern[:-1]
-        return u"(%s)" % pattern
+        return u"(%s)" % self._pattern
 
     def pageFilter(self):
         """ Page filter function for single title search """
--- a/MoinMoin/search/results.py	Wed Aug 23 03:07:56 2006 +0200
+++ b/MoinMoin/search/results.py	Wed Aug 23 20:40:55 2006 +0200
@@ -348,6 +348,7 @@
                     }
                 elif page.page.rev and page.page.rev != page.page.getRevList()[0]:
                     querydict = {
+                        'action': 'recall',
                         'rev': page.page.rev,
                     }
                 else:
@@ -431,6 +432,7 @@
                     fmt_context = self.formatContext(page, context, maxlines)
                     if page.page.rev and page.page.rev != page.page.getRevList()[0]:
                         querydict = {
+                            'action': 'recall',
                             'rev': page.page.rev,
                         }
                     else:
@@ -754,9 +756,7 @@
     def querystring(self, querydict=None):
         """ Return query string, used in the page link """
         if querydict is None:
-            querydict = {}
-        if 'action' not in querydict or querydict['action'] == 'AttachFile':
-            querydict.update({'highlight': self.query.highlight_re()})
+            querydict = {'highlight': self.query.highlight_re()}
         querystr = wikiutil.makeQueryString(querydict)
         #querystr = wikiutil.escape(querystr)
         return querystr