Skip to content

Commit

Permalink
fix hyphenation in tags search (#7954)
Browse files Browse the repository at this point in the history
* fix hyphenation in tags search

* Update _sorting.html.erb
  • Loading branch information
jywarren authored May 26, 2020
1 parent 3472545 commit 946a15c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/assets/javascripts/restful_typeahead.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ $(function() {
autoSelect: false,
source: debounce(function (query, process) {

query = query.replace(' ', /-/g); // replace spaces with hyphens
query = query.replace(' ', '-'); // replace spaces with hyphens
var encoded_query = encodeURIComponent(query);
var qryType = $(el).attr('qryType');
if (qryType == "tags") {
Expand Down
2 changes: 1 addition & 1 deletion app/views/tag/_sorting.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ line up nicely if the user is asked to login on the questions/index page -->
minLength: 3,
item: '<li class="dropdown-item"><a class="dropdown-item" href="#" role="option"></a></li>',
source: function (query, process) {
var replaced_query = query.replace(' ', /-/g);
var replaced_query = query.replace(' ', '-');
return $.post('/tag/suggested/' + replaced_query, {}, function (data) {
return process(data)
})
Expand Down

0 comments on commit 946a15c

Please sign in to comment.