Skip to content

Unescape all single quotes in raw string literals - #107

Open
n0liu wants to merge 1 commit into
jmespath:masterfrom
n0liu:fix-raw-string-escaped-quotes
Open

n0liu wants to merge 1 commit into
jmespath:masterfrom
n0liu:fix-raw-string-escaped-quotes

Conversation

@n0liu

@n0liu n0liu commented Oct 11, 2026

Copy link
Copy Markdown

Raw string literals currently unescape only their first escaped single quote. For example, a filter matching O'Reilly's book against a raw string containing two escaped quotes returns no matches because the second backslash remains in the value.

Use a global replacement in _consumeRawStringLiteral so every escaped single quote is unescaped. Other raw escapes remain untouched. Add six compliance cases covering multiple and consecutive quotes, quotes at both ends, preserved newline/Unicode escape text, separate raw literals, and a filter expression.

Fixes #98.

Validation (Node 22.21.1):

  • All six new cases fail against the unmodified base.
  • npm test: 894 passing.
  • Grunt default tasks: Uglify, JSHint, and ESLint passed.
  • The generated minified build passes all six new cases.

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.

Escape single quotes in a raw string literal

1 participant