Skip to content

Commit

Permalink
Update creating-the-widget-source.md
Browse files Browse the repository at this point in the history
  • Loading branch information
e3ndr authored Apr 12, 2024
1 parent 8c83e46 commit 8336181
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions Plugins Development/creating-the-widget-source.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,10 @@ Next, we need to make our widget html. The example provided just writes a simple
});
// When we get chat messages we want to append them to the chat log.
Koi.on("chat", (event) => {
Koi.on("rich_message", (event) => {
// escapeHtml is a helper function that escapes HTML characters. It's provided by the loader.
// Additionally, we replace all spaces with non-breaking spaces so they don't get broken up.
const html = `${event.sender.displayname} > ${escapeHtml(
event.message
).replace(/ /g, "&nbsp;")}<br />`;
const html = `${event.sender.displayname} > ${event.html}<br />`;
// Append it.
chatLog.innerHTML += html;
Expand Down

0 comments on commit 8336181

Please sign in to comment.