Skip to content

fix(project): handle escaped quotes in .strings files - #264

Closed
RaphaelFakhri wants to merge 1 commit into
ionic-team:mainfrom
RaphaelFakhri:fix/strings-escaped-quotes
Closed

RaphaelFakhri wants to merge 1 commit into
ionic-team:mainfrom
RaphaelFakhri:fix/strings-escaped-quotes

Conversation

@RaphaelFakhri

Copy link
Copy Markdown

Summary

The .strings parser ended a quoted key or value at any ", including an escaped \". The next character then threw Error parsing .strings file: unknown character, so ios.strings couldn't edit files such as an InfoPlist.strings containing "Allow \"App\" to use the camera". The parser also read /* and */ inside a quoted string as comment markers.

This change:

  • Keeps escape sequences inside keys and values verbatim, so \" doesn't end the string and the file round-trips unchanged.
  • Only detects comment markers outside quoted strings.

Testing

  • Added Should keep escaped quotes and comment markers inside strings to packages/project/test/strings-file.test.ts. It parses a file with escaped quotes and comment markers in keys and values and checks that it regenerates unchanged.
  • cd packages/project && npx vitest run test/strings-file.test.ts: 8 passed. With the fix reverted, the new test fails with Error parsing .strings file: unknown character at 2:39.
  • npm run typecheck -w packages/project passes.

Fixes #263

@vercel

vercel Bot commented Oct 20, 2026

Copy link
Copy Markdown

@RaphaelFakhri is attempting to deploy a commit to the Ionic Team on Vercel.

A member of the Team first needs to authorize it.

@robingenz

Copy link
Copy Markdown
Collaborator

Closed by #265

@robingenz robingenz closed this Oct 20, 2026
@RaphaelFakhri

Copy link
Copy Markdown
Author

Would appreciate some credit in the release notes

@robingenz

Copy link
Copy Markdown
Collaborator

Changelog is auto-generated and does not mention any authors directly, see https://github.com/ionic-team/trapeze/edit/main/packages/project/CHANGELOG.md. Your issue is linked.

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.

ios.strings fails on .strings files that contain escaped quotes

2 participants