Permalink
Browse files

[bookmarks] Handle pluralization typos when a query matches by tag or…

… comment
  • Loading branch information...
lovett committed Feb 10, 2019
1 parent ac88e98 commit 181424c24502266addfbc7f0e7c051b2bbcf2c5a
Showing with 7 additions and 1 deletion.
  1. +1 −1 apps/bookmarks/bookmarks.jinja.html
  2. +6 −0 plugins/bookmarks.py
@@ -61,7 +61,7 @@ <h2>
</p>

{% for tag in bookmark.tags or [] %}
<a class="tag" href="{{ app_url }}?query=tag:{{ tag|urlencode }}">
<a class="tag" href="{{ app_url }}?query=tags:{{ tag|urlencode }}">
<svg class="icon icon-tag"><use xlink:href="#icon-tag"></use></svg>
{{ tag }}
</a>
@@ -220,6 +220,12 @@ def search(self, query, limit=20, offset=0):

weight_string = ",".join(map(repr, weights))

if "tag:" in query:
query = query.replace("tag:", "tags:")

if "comment:" in query:
query = query.replace("comment:", "comments:")

return self._fts_search(
"""SELECT url, domain, title, rank,
comments, tags as 'tags [comma_delimited]',

0 comments on commit 181424c

Please sign in to comment.