Reformated jsonFormatter.js
This commit is contained in:
@@ -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);
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user