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

[BUG]: Cannot quote/escape search queries #13399

Closed
4 tasks done
Aquafina-water-bottle opened this issue Mar 4, 2023 · 4 comments
Closed
4 tasks done

[BUG]: Cannot quote/escape search queries #13399

Aquafina-water-bottle opened this issue Mar 4, 2023 · 4 comments

Comments

@Aquafina-water-bottle
Copy link

Checked for duplicates?

  • This issue is not a duplicate

What are the steps to reproduce this bug?

  1. Create any card with a field containing a"bc. For example, create a Basic card with Front -> a"bc, and Back -> abc back.
  2. Attempt to search for "Front:a\"bc"

Expected behaviour

The card should show in the results screen.

Actual behaviour

The card is not shown in the results screen.

Debug info

AnkiDroid Version = 2.16alpha94

Android Version = 11

Manufacturer = samsung

Model = SM-A705W

Hardware = qcom

Webview User Agent = Mozilla/5.0 (Linux; Android 11; SM-A705W Build/RP1A.200720.012; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/110.0.5481.153 Mobile Safari/537.36

ACRA UUID = 92deb424-7585-4976-afd5-787232deaf81

New schema = false

Scheduler = std2

Crash Reports Enabled = true

DatabaseV2 Enabled = true

(Optional) Anything else you want to share?

  • It is true that the search Front:a"bc would work. However, if the field contains a space, i.e. <span class="a">abc</span>, it becomes impossible to search for the exact string with say, "Front:<span class=\"a\">abc</span>".
  • The query works on Anki Desktop, so I believe it is expected to work on AnkiDroid as well.
  • I didn't test it on the latest stable release, only on the latest alpha release.
  • As random workarounds, I tried queries such as "Front:a\\"bc", "Front:a\\\"bc", and `Front:a"bc`. Unfortuately, none of them worked.

Research

  • I am reporting a bug specific to AnkiDroid (Android app)
  • I have checked the manual and the FAQ and could not find a solution to my issue
  • (Optional) I have confirmed the issue is not resolved in the latest alpha release (instructions)
@welcome
Copy link

welcome bot commented Mar 4, 2023

Hello! 👋 Thanks for logging this issue. Please remember we are all volunteers here, so some patience may be required before we can get to the issue. Also remember that the fastest way to get resolution on an issue is to propose a change directly, https://github.com/ankidroid/Anki-Android/wiki/Contributing

@Aquafina-water-bottle
Copy link
Author

Looking into the issue, I believe this function has to be reworked to be more similar to Anki's search parser.rs in order to support the functionality. (I believe that's the correct file/function, but I can't really read Rust code unfortunately)

@david-allison
Copy link
Member

New schema = false

Have you tried using the Rust backend in the advanced settings?

@david-allison david-allison added the Needs Author Reply Waiting for a reply from the original author label Mar 4, 2023
@Aquafina-water-bottle
Copy link
Author

New schema = false

Have you tried using the Rust backend in the advanced settings?

It was as simple as that, thank you so much!

@david-allison david-allison removed Bug Needs Author Reply Waiting for a reply from the original author Needs Triage labels Mar 4, 2023
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