Skip to content

Commit

Permalink
Merge pull request #11051 from nextcloud/fix/11023/parse-special-symb…
Browse files Browse the repository at this point in the history
…ols-in-store

fix(chat): patch stored message input
  • Loading branch information
nickvergessen authored Nov 30, 2023
2 parents 40b002d + f116836 commit 45bd819
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/store/quoteReplyStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,13 @@ const mutations = {
*/
setCurrentMessageInput(state, { token, text = null }) {
if (text !== null) {
Vue.set(state.currentMessageInput, token, text)
// FIXME upstream: https://github.com/nextcloud-libraries/nextcloud-vue/issues/4492
const temp = document.createElement('textarea')
temp.innerHTML = text?.replace(/&/gmi, '&') || ''
const parsedText = temp.value.replace(/&amp;/gmi, '&').replace(/&lt;/gmi, '<')
.replace(/&gt;/gmi, '>').replace(/&sect;/gmi, '§')

Vue.set(state.currentMessageInput, token, parsedText)
} else {
Vue.delete(state.currentMessageInput, token)
}
Expand Down

0 comments on commit 45bd819

Please sign in to comment.