Skip to content

Commit

Permalink
feat: Run DOMPurify.sanitize on textarea content
Browse files Browse the repository at this point in the history
  • Loading branch information
kordwarshuis committed Jan 31, 2024
1 parent 2fd13b4 commit 15e01c8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion public/js/collection.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ function loadCollections() {
console.log('save button clicked');
const editableTextarea = this.closest('.card-header').nextElementSibling;

chrome.runtime.sendMessage({ action: "editSaveTerm", entry: { term: this.dataset.term, uniqueId: this.dataset.uniqueid, newValue: editableTextarea.innerHTML } }, function (response) {
chrome.runtime.sendMessage({ action: "editSaveTerm", entry: { term: this.dataset.term, uniqueId: this.dataset.uniqueid, newValue: DOMPurify.sanitize(editableTextarea.innerHTML) } }, function (response) {
console.log("Response:", response);
loadCollections();
});
Expand Down

0 comments on commit 15e01c8

Please sign in to comment.