Skip to content

fix(effects): File Writer Newline Escapes (#3025)#3029

Merged
ebiggz merged 2 commits intocrowbartools:v5from
phroggster:fix/3025
Mar 10, 2025
Merged

fix(effects): File Writer Newline Escapes (#3025)#3029
ebiggz merged 2 commits intocrowbartools:v5from
phroggster:fix/3025

Conversation

@phroggster
Copy link
Collaborator

@phroggster phroggster commented Feb 28, 2025

Description of the Change

Update the Write to File effect's newline mangling:

  • Replaces backlash n in the effect text with a literal newline.
  • Replaces backslash backslash n in the text with a backslash n.
  • Temporarily uses the sub, ASCII 1A (base 16) 26 (base 10), or html  character for temporary staging to skip over the newline regex.
    • edit: Now uses a uuid to avoid trampling on anyone intentionally writing ASCII control characters.

Applicable Issues

#3025

Testing

Thoroughly wrote several newlines and backslash n characters to files, as desired.
Only downside: no one will be able to intentionally write a sub / html  character to a file afterwards.
edit: Verified intentionally writing sub control characters.

Screenshots

- Replace \n with a newline, but replace \\n with a backslash n.
- Temporarily uses the `sub`, ASCII 0x1A, html &crowbartools#26; character for temporary
  staging to skip over the newline regex.
- crowbartools#3025
@phroggster phroggster requested a review from ebiggz as a code owner February 28, 2025 14:30
- I do have to question why anyone might be writing low ASCII control
  characters to a file, but they can do so freely now.
@ebiggz ebiggz merged commit 290917e into crowbartools:v5 Mar 10, 2025
2 checks passed
@phroggster phroggster deleted the fix/3025 branch March 10, 2025 07:23
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.

2 participants