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

fix: support special characters in filters #315

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

angeloashmore
Copy link
Member

@angeloashmore angeloashmore commented Aug 4, 2023

Types of changes

  • Chore (a non-breaking change which is related to package maintenance)
  • Bug fix (a non-breaking change which fixes an issue)
  • New feature (a non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Description

This PR fixes a bug where special charcters, such as ", were not escaped in filters.

Before this PR (note the double ""):

import { filter } from "@prismicio/client";

filter.fulltext("my.page.key_text_field", '"quote"');
// => [fulltext(my.page.key_text_field, ""quote"")]

After this PR (note the escaped "):

import { filter } from "@prismicio/client";

filter.fulltext("my.page.key_text_field", '"quote"');
// => [fulltext(my.page.key_text_field, "\"quote\"")]

Fixes #314

Checklist:

  • My change requires an update to the official documentation.
  • All TSDoc comments are up-to-date and new ones have been added where necessary.
  • All new and existing tests are passing.

🦡

@codecov-commenter
Copy link

Codecov Report

Merging #315 (718a2f1) into master (76fa2ca) will not change coverage.
The diff coverage is 100.00%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

@@           Coverage Diff           @@
##           master     #315   +/-   ##
=======================================
  Coverage   99.96%   99.96%           
=======================================
  Files          50       50           
  Lines        6045     6045           
  Branches      294      294           
=======================================
  Hits         6043     6043           
  Misses          2        2           
Files Changed Coverage Δ
src/filter.ts 100.00% <100.00%> (ø)

@angeloashmore angeloashmore marked this pull request as ready for review October 10, 2023 19:53
@angeloashmore angeloashmore requested a review from lihbr October 10, 2023 19:54
Copy link
Member

@lihbr lihbr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@cpatti97100
Copy link

Hi all, is thins going to be merged soon? thanks! :)

@lihbr
Copy link
Member

lihbr commented Jul 22, 2024

Can we merge that @angeloashmore?

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

Successfully merging this pull request may close these issues.

dangerouslyGetAll and double quotes in fulltext predicate
4 participants