Crauzer / Obsidian

Wad archive editor for League of Legends
GNU General Public License v3.0
555 stars 99 forks source link

Auto prettify `.json` chunk preview text #249

Open Mrgaton opened 2 months ago

Mrgaton commented 2 months ago

image

Since the project is made in TypeScript, it would not be difficult to automatically auto-pretify the json files.

Crauzer commented 2 months ago

The screenshot you posted is of Obsidian v5 which is written in C#. At the time of development there was no prettifying library in C# for doing this.

However, it might be possible to implement this using something like prettier in v6

Mrgaton commented 2 months ago

it's not necessary to use prettier i think you can just do

JSON.stringify(JSON.parse(data.toString('utf-8')), null, 2)