TeamMidnightDust / MidnightLib

Common Library for Team MidnightDust's mods. Provides a config api, common utils, and cosmetics.
https://midnightdust.eu/midnightlib
MIT License
31 stars 15 forks source link

stray \n somewhere in quilt.mod.json #28

Closed Merith-TK closed 1 year ago

Merith-TK commented 1 year ago

I was making a tool that automatically parses mod.json in jars to automatically remove duplicates, and I ran into an wierd issue decoding the json

$ go run .
2023/04/16 17:05:36 ./mods/midnightlib-quilt-1.3.0.jar
2023/04/16 17:05:36 [DECODE QUILT MOD] invalid character '\n' in string literal

I was able to manually fix it by removing all \n characters in the json and reformatting, figured I would inform you

Merith-TK commented 1 year ago

found it image ripped straight from the mod.json

manually patching mod json to have an proper \n there fixes it (as shown by here, filename is only printed if there is an error decoding json) image

Motschen commented 1 year ago

How would I insert a proper \n character?

Merith-TK commented 1 year ago

Sorry I didnt reply here but it looks like the compiler is incorrectly converting the escaped \n into a literal, for some reason, will see if I still have my tool for it so you can take a look at how I discovered this