Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto prettify .json chunk preview text #249

Open
Mrgaton opened this issue Jun 19, 2024 · 2 comments
Open

Auto prettify .json chunk preview text #249

Mrgaton opened this issue Jun 19, 2024 · 2 comments

Comments

@Mrgaton
Copy link

Mrgaton commented Jun 19, 2024

image

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

@Crauzer
Copy link
Owner

Crauzer commented Jun 19, 2024

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

@Crauzer Crauzer changed the title Auto prettify json Auto prettify .json chunk preview text Jun 19, 2024
@Mrgaton
Copy link
Author

Mrgaton commented Jun 19, 2024

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants