Fixed search transform removing numbers from query

This commit is contained in:
squidfunk 2020-06-23 08:45:49 +02:00
parent 792494f4cf
commit a3c03aefb9
5 changed files with 7 additions and 7 deletions

View File

@ -1,6 +1,6 @@
{
"assets/javascripts/bundle.js": "assets/javascripts/bundle.dd72b84b.min.js",
"assets/javascripts/bundle.js.map": "assets/javascripts/bundle.dd72b84b.min.js.map",
"assets/javascripts/bundle.js": "assets/javascripts/bundle.38f5c9b5.min.js",
"assets/javascripts/bundle.js.map": "assets/javascripts/bundle.38f5c9b5.min.js.map",
"assets/javascripts/vendor.js": "assets/javascripts/vendor.de50e36d.min.js",
"assets/javascripts/vendor.js.map": "assets/javascripts/vendor.de50e36d.min.js.map",
"assets/javascripts/worker/search.js": "assets/javascripts/worker/search.9b3611bd.min.js",

View File

@ -183,7 +183,7 @@
</div>
{% block scripts %}
<script src="{{ 'assets/javascripts/vendor.de50e36d.min.js' | url }}"></script>
<script src="{{ 'assets/javascripts/bundle.dd72b84b.min.js' | url }}"></script>
<script src="{{ 'assets/javascripts/bundle.38f5c9b5.min.js' | url }}"></script>
{%- set translations = {} -%}
{%- for key in [
"clipboard.copy",

View File

@ -49,7 +49,7 @@ export type SearchTransformFn = (value: string) => string
*/
export function defaultTransform(value: string): string {
return value
.replace(/(?:^|\s+)[*+-:^~]+(?=\s+|$)/g, "")
.replace(/(?:^|\s+)[*+\-:^~]+(?=\s+|$)/g, "")
.trim()
.replace(/\s+|(?![^\x00-\x7F]|^)$|\b$/g, "* ")
}