Skip to content

Commit

Permalink
Don't interpret chat messages as HTML
Browse files Browse the repository at this point in the history
Fixes #638
  • Loading branch information
JLyne committed Dec 23, 2023
1 parent 32b4875 commit 2c8473e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/chat/ChatMessage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<PlayerImage v-if="showFace && message.playerAccount" :player="message.playerAccount" width="16" height="16" class="message__face" />
<span v-if="messageChannel" class="message__channel" v-html="messageChannel"></span>
<span v-if="showSender" class="message__sender" v-html="message.playerName"></span>
<span class="message__content" v-html="messageContent"></span>
<span class="message__content">{{ messageContent }}</span>
</li>
</template>

Expand Down
4 changes: 3 additions & 1 deletion src/components/map/marker/PlayerMarker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,9 @@ export default defineComponent({
updateChatBalloon = () => {
const content = playerChat.value.reduceRight<string>((previousValue, currentValue) => {
return previousValue + `<span>${currentValue.message}</span>`;
const span = document.createElement('span');
span.appendChild(document.createTextNode(currentValue.message || ''));
return previousValue + span.outerHTML;
}, '');
//Update balloon if content has changed
Expand Down

0 comments on commit 2c8473e

Please sign in to comment.