|
a/Allura/allura/lib/search.py |
|
b/Allura/allura/lib/search.py |
|
... |
|
... |
44 |
# Convert text to plain text (It usually contains markdown markup).
|
44 |
# Convert text to plain text (It usually contains markdown markup).
|
45 |
# To do so, we convert markdown into html, and then strip all html tags.
|
45 |
# To do so, we convert markdown into html, and then strip all html tags.
|
46 |
text = doc['text']
|
46 |
text = doc['text']
|
47 |
text = g.markdown.convert(text)
|
47 |
text = g.markdown.convert(text)
|
48 |
doc['text'] = jinja2.Markup.escape(text).striptags()
|
48 |
doc['text'] = jinja2.Markup.escape(text).striptags()
|
49 |
# striptags decodes html entities, so we should escape them again
|
|
|
50 |
doc['text'] = jinja2.Markup.escape(doc['text'])
|
|
|
51 |
return doc
|
49 |
return doc
|
52 |
|
50 |
|
53 |
class SearchError(SolrError):
|
51 |
class SearchError(SolrError):
|
54 |
pass
|
52 |
pass
|
55 |
|
53 |
|
|
... |
|
... |
199 |
params = request.GET.copy()
|
197 |
params = request.GET.copy()
|
200 |
params.update({'sort': score_url})
|
198 |
params.update({'sort': score_url})
|
201 |
score_url = url(request.path, params=params)
|
199 |
score_url = url(request.path, params=params)
|
202 |
params.update({'sort': date_url})
|
200 |
params.update({'sort': date_url})
|
203 |
date_url = url(request.path, params=params)
|
201 |
date_url = url(request.path, params=params)
|
204 |
return dict(q=q, history=history, results=results or [],
|
202 |
return dict(q=q, history=history, results=list(results) or [],
|
205 |
count=count, limit=limit, page=page, search_error=search_error,
|
203 |
count=count, limit=limit, page=page, search_error=search_error,
|
206 |
sort_score_url=score_url, sort_date_url=date_url,
|
204 |
sort_score_url=score_url, sort_date_url=date_url,
|
207 |
sort_field=field)
|
205 |
sort_field=field)
|
208 |
|
206 |
|
209 |
|
207 |
|