Skip to content

Commit

Permalink
Add width and indent parameters for topic viewer
Browse files Browse the repository at this point in the history
  • Loading branch information
okalachev committed Jun 17, 2024
1 parent 4e4dfc1 commit 3a08085
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions clover/www/js/topics.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,11 @@ function viewTopic(topic) {
}
}

let txt = `<div class=counter>${counter} received</div>${YAML.stringify(msg)}`; // JSON.stringify(msg, null, 4);
topicMessage.innerHTML = txt;
let width = Number(params.width) || 100;
let indent = Number(params.indent) || 2;
let txt = YAML.stringify(msg, { lineWidth: width, indent: indent });
let html = `<div class=counter>${counter} received</div>${txt}`; // JSON.stringify(msg, null, 4);
topicMessage.innerHTML = html;
});
}

Expand Down

0 comments on commit 3a08085

Please sign in to comment.