Skip to content

Feat: Added extra argument and test for the save option for text files - #9142

Open
Pranava-Pai-N wants to merge 5 commits into
processing:mainfrom
Pranava-Pai-N:feat/save-clrf
Open

Pranava-Pai-N wants to merge 5 commits into
processing:mainfrom
Pranava-Pai-N:feat/save-clrf

Conversation

@Pranava-Pai-N

Copy link
Copy Markdown

Resolves #9141

Changes:
Added third argument for saving txt files along with the required tests

PR Checklist

  • npm run lint passes
  • [Inline reference] is included / updated
  • [Unit tests] are included / updated

@perminder-17 perminder-17 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, thanks for contributing!

Could you please provide a little more context about the issue? I just came across it, but I’m not fully clear on what was missing and how this PR fixes the issue.

@Pranava-Pai-N

Pranava-Pai-N commented Sep 16, 2026

Copy link
Copy Markdown
Author

Hi @perminder-17 , thank you for the review and the doubt regarding the PR :
This PR fixes a bug where the optional CRLF flag was being dropped when saving text files through save(). The issue was that save() passed only three arguments to saveStrings(), so true for Windows-style \r\n line endings never reached the actual writer. The fix forwards the missing fourth argument, so text files can correctly preserve CRLF when requested.

The main consequence is that text files saved via save() would always use \n line endings, even when the caller explicitly asked for CRLF (true). That can cause Windows-style line-ending expectations to fail, especially when files are opened or processed by tools that rely on \r\n for compatibility.

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.

[p5.js 2.0+ Bug Report]: save() ignores the CRLF option when saving text files

2 participants