Skip to content

Commit 75c1981

Browse files
authored
Merge pull request #627 from jembi/feat/format-custom-json-content
Allow for beautification of custom json header
2 parents b403f98 + e7e76ad commit 75c1981

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

app/scripts/utils/utils.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@ export function beautifyIndent (type, content) {
6060
if (/.*application\/\w+\+xml.*/.test(type)) {
6161
return { lang: 'xml', content: pd.xml(content, 2) }
6262
}
63+
64+
// application/{word characters}+json.
65+
if (/application\/\w+\+json/.test(type)) {
66+
return { lang: 'json', content: pd.json(content, 2) }
67+
}
6368
} catch (err) {
6469
console.log(err)
6570
return { lang: '', content }

0 commit comments

Comments
 (0)