simplify updateSpaceApiJson

This commit is contained in:
Thomas Rupprecht 2023-01-05 14:29:15 +01:00
parent 6c95aa978e
commit 859f9bce19

View file

@ -109,14 +109,8 @@ function updateNextEvent(nextEvents) {
* @param {object} spaceApi * @param {object} spaceApi
*/ */
function updateSpaceApiJson(spaceApi) { function updateSpaceApiJson(spaceApi) {
const json = JSON.stringify(spaceApi, null, 2)
.replace(/ /g, ' ')
.replace(/\n/g, '<br/>');
const spaceApiElement = document.querySelector('#space-api > code'); const spaceApiElement = document.querySelector('#space-api > code');
spaceApiElement.innerHTML = json; spaceApiElement.textContent = JSON.stringify(spaceApi, null, 2);
// const jsonNode = document.createTextNode(json);
// spaceApiElement.innerText = '';
// spaceApiElement.append(jsonNode);
} }
/** /**