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

Trim start (and maybe end) of search queries #49

Open
curche opened this issue Oct 20, 2023 · 2 comments
Open

Trim start (and maybe end) of search queries #49

curche opened this issue Oct 20, 2023 · 2 comments

Comments

@curche
Copy link

curche commented Oct 20, 2023

Example cases
{{ kimi no na wa}}
{{ kimi no nowa}}
<< planetes>>
<>

@ghostbear
Copy link
Owner

ghostbear commented Oct 21, 2023

The current regex pattern for the queries disallow space at the start.
Why? To avoid accidental triggers.

a <<valid>> query
a<<invalid>> query
another << invalid>> query
yet another <<invalid >> query

But that doesn't seem like a problem you say and for that case it would probably be fine but what if someone starts writing code that bit shifts left and right and we allow space at start

int value = 5;
int result = 1 << value & 0xFF >> 1; // valid trigger if we allow spaces before and/or after

Now the question becomes to allow or disallow this behavior.

@curche
Copy link
Author

curche commented Oct 22, 2023

Ideally code shud go inside ` or ``` and that could be handled separately hopefully?
if not, just let it get triggered
its a tradeoff I'm willing to have
its been a while I have seen someone ask about bitshift (except for a screenshot that contained a comparison between bitshifts between c/c++, lua, dart)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants