Skip to content

Commit 534f801

Browse files
committed
- fix minification feature
1 parent b3a17ac commit 534f801

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

tools/json_formatter.html

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -787,7 +787,20 @@ <h1>JSON Formatter</h1>
787787
try {
788788
const parsedJson = formatJSON(inputValue, true);
789789
if (parsedJson) {
790-
renderJSON(parsedJson);
790+
while (jsonOutput.firstChild) {
791+
jsonOutput.removeChild(jsonOutput.firstChild);
792+
}
793+
794+
placeholder.style.display = 'none';
795+
jsonOutput.style.display = 'block';
796+
797+
const pre = document.createElement('pre');
798+
pre.style.margin = '0';
799+
pre.style.whiteSpace = 'pre-wrap';
800+
pre.style.wordBreak = 'break-all';
801+
pre.textContent = formattedJson;
802+
jsonOutput.appendChild(pre);
803+
791804
showNotification('JSON minified!');
792805
}
793806
} catch (error) {

0 commit comments

Comments
 (0)