Repository navigation
fix(project): keep escaped quotes in .strings files - #265
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
🟢 Approval recommended
The focused parser fix addresses the reported failures with regression coverage and no unresolved findings.
No open issues 🎉
What changed in this PR
Fixes .strings parsing so iOS string operations can handle escaped quotes and comment markers inside quoted keys and values, addressing #263.
Changes:
- Centralizes quoted-string parsing while preserving escape sequences verbatim.
- Adds a fixture and regression tests for parsing, unchanged regeneration, and setting adjacent keys.
| File | Description |
|---|---|
| packages/project/test/strings-file.test.ts | Tests parsing, regeneration, and updates around escaped strings. |
| packages/project/src/util/strings.ts | Handles escapes and treats quoted comment markers as text. |
| packages/common/test/fixtures/strings-escaped.strings | Provides escaped quotes and embedded comment markers for regression tests. |
Review effort: Balanced
Merged
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The
.stringsparser ended a key or value at any", including an escaped\". A file like this failed to load withError parsing .strings file: unknown character, so everyios.stringsoperation on it failed:It also treated
/*and*/inside a quoted string as comment markers.Changes
"ends the string. A\and the character after it are kept verbatim, and/*,*/are plain text.strings-escaped.stringswith escaped quotes in a key and a value, plus comment markers in a value.StringsFile, check the parsed entries, regenerate the file unchanged, and set a key next to escaped values.Closes #263
Supersedes #264