Quick fix for searching identifiers with commas

Fixes #309, both manual search and display in search bar.
This commit is contained in:
Franciszek Stachura 2024-08-02 13:20:30 +02:00
parent 06ba355912
commit f5f49b6b39
3 changed files with 5 additions and 4 deletions

View file

@ -534,7 +534,8 @@ def generate_ident_page(q, basedir, parsed_path):
project = parsed_path.project
source_base_url = f'/{ project }/{ version }/source'
symbol_definitions, symbol_references, symbol_doccomments = q.query('ident', version_unquoted, ident, family)
ident_unquoted = parse.unquote(ident)
symbol_definitions, symbol_references, symbol_doccomments = q.query('ident', version_unquoted, ident_unquoted, family)
symbol_sections = []
@ -583,7 +584,7 @@ def generate_ident_page(q, basedir, parsed_path):
data = {
**get_layout_template_context(q, basedir, get_url_with_new_version, project, version),
'searched_ident': ident,
'searched_ident': ident_unquoted,
'current_family': family,
'symbol_sections': symbol_sections,

View file

@ -1,7 +1,7 @@
{% extends "layout.html" %}
{% block title %}
{{ searched_ident }} identifier - {{ current_project|capitalize }} source code {{ current_tag }} - Bootlin
{{ searched_ident|e }} identifier - {{ current_project|capitalize }} source code {{ current_tag }} - Bootlin
{% endblock %}
{% block main %}

View file

@ -18,7 +18,7 @@
</select>
<input placeholder="Search Identifier" type="text" id="search-input" name="i"
value="{{ searched_ident|default('') }}" autofocus/>
value="{{ searched_ident|default('')|e }}" autofocus/>
<button class="icon-search"><span class="screenreader">Go get it</span></button>
</form>
</div>