prismic-client icon indicating copy to clipboard operation
prismic-client copied to clipboard

fix: support special characters in filters

Open angeloashmore opened this issue 2 years ago • 3 comments

Types of changes

  • [ ] Chore (a non-breaking change which is related to package maintenance)
  • [x] 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.
  • [x] All TSDoc comments are up-to-date and new ones have been added where necessary.
  • [x] All new and existing tests are passing.

🦡

angeloashmore avatar Aug 04 '23 01:08 angeloashmore

Codecov Report

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

:exclamation: 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%> (ø)

codecov-commenter avatar Aug 04 '23 01:08 codecov-commenter

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

cpatti97100 avatar Jan 17 '24 09:01 cpatti97100

Can we merge that @angeloashmore?

lihbr avatar Jul 22 '24 09:07 lihbr

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

cpatti97100 avatar Nov 04 '25 09:11 cpatti97100