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
Highlighter returns unexpected results if one term is found within another #378
Comments
I added one potential solution which makes the output look like the expected result above. Basically, if there would be two highlight areas that overlap or coincide, it just highlights the first one. |
I added a test for this fix. Without the fix, the test fails. After the fix is added, the test passes. |
…f one term is found within another.
I ran into this issue too. IMHO this fix is not addressing the correct problem, which is that
Let me know if you'd like me to make a pull request. Incidentally in the meantime if anyone wants to correct this behaviour themselves, they can use a custom highlighter - see this gist. |
I agree with @seddonym. Maybe just close this issue? |
Actual result:
Note that the text to highlight is just "portland", but the highlighter is tacking "or" + "tland" onto the end as well.
Expected result:
Or perhaps:
I'm using haystack 1.2.4.
The text was updated successfully, but these errors were encountered: