Reformated jsonFormatter.js

This commit is contained in:
2023-05-15 11:58:05 +02:00
parent 18d9e654d2
commit cad01a4285

View File

@@ -161,21 +161,6 @@ const mergeHTMLPlugin = (function () {
}()); }());
/**
* This function is executed after the page is loaded.
*
* @function
* @name init
* @kind function
*/
function init() {
// Make sure that only plain text is pasted
configurePastingInElement("jsonBlock");
hljs.addPlugin(mergeHTMLPlugin);
}
function formatAndValidateJson(errorElement) { function formatAndValidateJson(errorElement) {
const input = document.querySelector('#jsonBlock'); const input = document.querySelector('#jsonBlock');
const processInfo = document.getElementById(errorElement); const processInfo = document.getElementById(errorElement);
@@ -248,3 +233,18 @@ function formatAndValidateJson(errorElement) {
input.textContent = "{\"enter\": \"your\", \"json\": \"here\"}"; input.textContent = "{\"enter\": \"your\", \"json\": \"here\"}";
hljs.highlightElement(input); hljs.highlightElement(input);
} }
/**
* This function is executed after the page is loaded.
*
* @function
* @name init
* @kind function
*/
function init() {
// Make sure that only plain text is pasted
configurePastingInElement("jsonBlock");
hljs.addPlugin(mergeHTMLPlugin);
}