Skip to content

Commit

Permalink
Replace innerHTML to preserve Trusted Types
Browse files Browse the repository at this point in the history
see #1947

Co-Authored-By: Klára Petrovičová <109086288+klarapetrovicova@users.noreply.github.com>
  • Loading branch information
dimsemenov and klarapetrovicova committed Jul 22, 2022
1 parent 9a39c55 commit ddcad46
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/js/slide/content.js
Expand Up @@ -349,7 +349,7 @@ class Content {
);
this.element = createElement('pswp__content pswp__error-msg-container');
this.element.appendChild(errorMsgEl);
this.slide.container.innerHTML = '';
this.slide.container.innerText = '';
this.slide.container.appendChild(this.element);
this.slide.updateContentSize(true);
this.removePlaceholder();
Expand Down
2 changes: 1 addition & 1 deletion src/js/slide/slide.js
Expand Up @@ -106,7 +106,6 @@ class Slide {

// Slide appended to DOM
if (!this.data) {
this.holderElement.innerHTML = '';
return;
}

Expand Down Expand Up @@ -211,6 +210,7 @@ class Slide {
destroy() {
this.content.hasSlide = false;
this.content.remove();
this.container.remove();
this.pswp.dispatch('slideDestroy', { slide: this });
}

Expand Down

0 comments on commit ddcad46

Please sign in to comment.