Skip to content

Commit

Permalink
Fix HTML entity rendering in file comments
Browse files Browse the repository at this point in the history
Signed-off-by: Christopher Ng <chrng8@gmail.com>
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
  • Loading branch information
Pytal authored and nextcloud-command committed Oct 1, 2021
1 parent fb2fd34 commit b81f217
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
4 changes: 2 additions & 2 deletions apps/comments/js/comments-app.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion apps/comments/js/comments-app.js.map

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion apps/comments/src/components/Comment.vue
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,12 @@ export default {
if (this.isEmptyMessage) {
return ''
}
return this.renderContent(this.localMessage)
// Double-unescape potentially double-escaped localMessage
let message = this.localMessage
for (let i = 0; i < 2; i++) {
message = new DOMParser().parseFromString(message, 'text/html').documentElement.textContent
}
return this.renderContent(message)
},
isEmptyMessage() {
Expand Down

0 comments on commit b81f217

Please sign in to comment.