Details
JSON.stringify escapes to the six-character sequence, so any literal control character supplied via YAML can never
reconstruct the marker. The internal callers (makeFieldsWithInternalCode)
keep emitting real bytes, so the legitimate flow continues to
work and no user content is silently mutated.
Defence-in-depth
Regardless of which option ships, the migration code should also:
- Reject
forestryField.label/.namethat contain newlines or NUL bytes (Forestry never produced them). - Wrap the eventual
prettier.format(...)call so that if formatting fails the build aborts (today an exception is propagated, which is good — keep it that way).
---
Credit
Reported by AnGrY-Althaf ([email protected]).
End-to-end PoC executed locally against[email protected] / @tinacms/[email protected] built from commit ae1ab5d0f
of https://github.com/tinacms/tinacms.