diff options
-rw-r--r-- | src/components/LeftSidebar/ConversationsList/Conversation.vue | 4 | ||||
-rw-r--r-- | src/components/NewMessageForm/NewMessageForm.vue | 10 |
2 files changed, 14 insertions, 0 deletions
diff --git a/src/components/LeftSidebar/ConversationsList/Conversation.vue b/src/components/LeftSidebar/ConversationsList/Conversation.vue index 584deb5e4..177c41090 100644 --- a/src/components/LeftSidebar/ConversationsList/Conversation.vue +++ b/src/components/LeftSidebar/ConversationsList/Conversation.vue @@ -186,6 +186,8 @@ export default { if (this.item.lastMessage.actorId === this.$store.getters.getUserId()) { return t('spreed', 'You: {lastMessage}', { lastMessage: this.simpleLastChatMessage, + }, undefined, { + escape: false, }) } @@ -197,6 +199,8 @@ export default { return t('spreed', '{actor}: {lastMessage}', { actor: this.shortLastChatMessageAuthor, lastMessage: this.simpleLastChatMessage, + }, undefined, { + escape: false, }) }, diff --git a/src/components/NewMessageForm/NewMessageForm.vue b/src/components/NewMessageForm/NewMessageForm.vue index a80ef40ec..1867155e4 100644 --- a/src/components/NewMessageForm/NewMessageForm.vue +++ b/src/components/NewMessageForm/NewMessageForm.vue @@ -126,6 +126,14 @@ export default { text = text.replace(/<br>/g, '\n') text = text.replace(/ /g, ' ') + // Since we used innerHTML to get the content of the div.contenteditable + // it is escaped. With this little trick from https://stackoverflow.com/a/7394787 + // We unescape the code again, so if you write `<strong>` we can display + // it again instead of `<strong>` + const temp = document.createElement('textarea') + temp.innerHTML = text + text = temp.value + // Although the text is fully trimmed, at the very least the last // "\n" occurrence should be always removed, as browsers add a // "<br>" element as soon as some rich text is written in a content @@ -133,6 +141,7 @@ export default { // will be "<br><br>"). return text.trim() }, + /** * Create a temporary message that will be used until the * actual message object is retrieved from the server @@ -181,6 +190,7 @@ export default { throw new Error(t('files', 'Invalid path selected')) } + // FIXME move to service axios.post( generateOcsUrl('apps/files_sharing/api/v1', 2) + 'shares', { |