Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change search request query to include escape character if theres illegal characters #7669

Conversation

JaydenTeoh
Copy link
Collaborator

@JaydenTeoh JaydenTeoh commented Mar 15, 2023

Closes #7618

Upon clicking submit, change request query and input text field to include escape characters in front of the illegal characters

Previous:
https://openlibrary.org/search?q=Cornell+%2777%3A+The+Music%2C+the+Myth+and+the+Magnificence+of+the+Grateful+Dead+Show+at+Barton+Hall&mode=everything

Now:
https://openlibrary.org/search?q=Cornell+%5C%2777%5C%3A+The+Music%2C+the+Myth+and+the+Magnificence+of+the+Grateful+Dead+Show+at+Barton+Hall&mode=everything

Screenshot

Before search submit:
image

After search submit:
image

Stakeholders

@tfmorris created issue
@cdrini lead

@JaydenTeoh JaydenTeoh changed the title change request query to include quotes if theres illegal characters change search request query to include quotes if theres illegal characters Mar 15, 2023
@tfmorris
Copy link
Contributor

If you quote the whole search phrase, I suspect it's going to change the semantics of the search. A better approach, I believe, would be to escape the problematic characters.

@JaydenTeoh
Copy link
Collaborator Author

If you quote the whole search phrase, I suspect it's going to change the semantics of the search. A better approach, I believe, would be to escape the problematic characters.

I see, that makes sense, I'll try out using the escape character and push the changes!

@JaydenTeoh JaydenTeoh changed the title change search request query to include quotes if theres illegal characters change search request query to include escape character if theres illegal characters Mar 19, 2023
@mekarpeles mekarpeles added the Priority: 2 Important, as time permits. [managed] label Apr 3, 2023
@cdrini
Copy link
Collaborator

cdrini commented May 30, 2023

This should be done on the backend, not the JS; that way it will also fix the /search.json endpoint.

I left a comment on the issue with more details: #7618 (comment)

@cdrini cdrini added Priority: 3 Issues that we can consider at our leisure. [managed] Needs: Submitter Input Waiting on input from the creator of the issue/pr [managed] and removed Priority: 2 Important, as time permits. [managed] labels May 30, 2023
@JaydenTeoh JaydenTeoh closed this Jun 4, 2023
@JaydenTeoh JaydenTeoh deleted the 7618/fix/illegal-characters-search branch June 10, 2023 12:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs: Submitter Input Waiting on input from the creator of the issue/pr [managed] Priority: 3 Issues that we can consider at our leisure. [managed]
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Search results page fails to render if search string includes special characters
4 participants