Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

[bug] Escaped quotes in a quoted keyword search are searched with the backslashes

Đang mở
#1,687 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

  • #1688 của @breken-ai — đã đóng, không merge

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
typescript
Lĩnh vực
search

Hướng nghiên cứu

Start in packages/web/src/features/search/parser.ts, focusing on the QuotedTerm and ContentExpr cases of transformTreeToIR. Run the parser unit tests and inspect parseQuerySyntaxIntoIR for quoted keyword and content: values. Done means escaped quotes and backslashes produce the intended substring pattern in keyword mode while regex mode remains unchanged.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Describe the bug

The syntax reference says "foo \"bar\"" matches files containing foo "bar". In keyword mode (the default) it matches nothing: the parser strips the outer quotes but keeps the backslashes, so zoekt gets the substring foo \"bar\". The same happens with \\ and with quoted content: values.

Expected: in keyword mode, \" and \\ inside a quoted term are unescaped before the substring query is built. Regex mode can keep them as-is.

To reproduce
  1. Index a repo with a file containing foo "bar".
  2. Search "foo \"bar\"" in keyword mode. No results.

Or in code: parseQuerySyntaxIntoIR on "foo \"bar\"" returns substring.pattern = foo \"bar\" instead of foo "bar". The cause is the QuotedTerm and ContentExpr cases of transformTreeToIR in packages/web/src/features/search/parser.ts.

Sourcebot deployment information

Sourcebot version (e.g. v3.0.1): main @ b4931510 (found reading the source and confirmed with a unit test, not on a deployment)

Additional information

I have a small fix with tests ready and will open a PR that links this issue. (Found by an AI coding agent working for the breken-ai account.)

Ngôn ngữ chính
TypeScript
Star
3.9k
Fork
374
Merge trung bình
2 ngày 21 giờ
Pull request đã merge (30 ngày)
43

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của sourcebot-dev/sourcebot

Tất cả issue của sourcebot-dev/sourcebot

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.