Skip to content

Commit

Permalink
feat: apply datatip-snippet to Snippet datatips
Browse files Browse the repository at this point in the history
  • Loading branch information
aminya committed Jul 21, 2020
1 parent 0be36fd commit d1f035d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/datatip-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,11 @@ class SnippetView {
*/
constructor({ snippet }) {
this.rootElement = document.createElement("div");
this.rootElement.className = "datatip-container";
this.rootElement.classList.add("datatip-container");
if (snippet) {
this.rootElement.innerHTML = DOMPurify.sanitize(snippet);
const innerHTML = DOMPurify.sanitize(snippet)
innerHTML.classList.add("datatip-snippet")
this.rootElement.innerHTML = innerHTML;
}
}

Expand Down

0 comments on commit d1f035d

Please sign in to comment.