Skip to content

jsonc/v0.1.5

Choose a tag to compare

@khanakia khanakia released this 13 Nov 15:20
· 16 commits to main since this release

Fixed

  • Text inserted into a file that mixes LF and CRLF took its line ending from a line break inside a block comment. In {/*\r\n*/\n}, Set wrote a CRLF that Delete then left behind, so Set then Delete no longer gave back the input. Inserted text now uses the break where it goes, or the line break just before the new line, or the document's first line break outside a comment, never one inside a block comment. This covers Set and SetAfter/SetBefore on objects, Append/Insert on arrays, SetComment and the comments Merge copies. Found by FuzzSetDelete; the input is kept as a fuzz seed, and a table test covers each mixed LF/CRLF layout.
  • format.Format took the line ending from the first line break anywhere, so a CRLF inside a block comment turned an LF file into a CRLF one. It now uses the first break outside a block comment or string.