Skip to content

Conversation

@StefRommesVITO
Copy link
Contributor

Summary

Adds logic to differentiate between CRLF and LF

(The new option as described in the readme doesn't work, but to me other options like indentationCharacter also have issues. The auto detection does work however.)

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have checked my code and corrected any misspellings

@StefRommesVITO
Copy link
Contributor Author

StefRommesVITO commented Nov 28, 2025

The toString() formatting only seems to work for some options and only after a .reset() which removes comments. For example indentationCharacter seems already broken, so it is not just the one I added.

@marcospassos
Copy link
Member

Thanks for the PR.

The toString() formatting only seems to work for some options and only after a reset() which removes comments. For example indentationCharacter seems already broken, so it is not just the one I added.

That is the intended behavior. It keeps the current formatting unless you reset or introduce something the parser has not seen before, for example adding a new entry with an array when the current JSON has no array entries.

I will take a look soon.

@marcospassos marcospassos added the feature New feature label Dec 1, 2025
@marcospassos marcospassos changed the title Fix issue 9 Add support for configurable line ends Dec 1, 2025
@marcospassos
Copy link
Member

I've pushed a few suggestions. The most significant one is renaming the option to lineEnding, since "character" is not accurate here: CRLF is a sequence of two characters.

@marcospassos marcospassos merged commit 330e43e into croct-tech:master Dec 1, 2025
4 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Extra new lines

2 participants