Skip to content

Commit

Permalink
Fix DOMPurify for breaking changes.
Browse files Browse the repository at this point in the history
Recently, DOMPurify has started providing their own types, which was
conflicting with DefinitelyTyped type definitions. This commit removes
DefinitelyTyped as types provided there seems to be now useless and
could be outdated after recent DOMPurify updates.
  • Loading branch information
SpacingBat3 committed Aug 23, 2022
1 parent ae04536 commit b49ed33
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
"@electron/fuses": "^1.5.0",
"@reforged/maker-appimage": "^1.0.2",
"@tsconfig/node16-strictest": "^1.0.0",
"@types/dompurify": "^2.3.3",
"@types/marked": "^4.0.2",
"@types/node": "^18.6.4",
"@types/semver": "^7.3.9",
Expand Down
2 changes: 1 addition & 1 deletion sources/code/renderer/preload/docs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function getId(url:string) {
}

function loadMarkdown(mdBody: HTMLElement, mdFile: string) {
mdBody.innerHTML = sanitize(marked.parse(readFileSync(mdFile).toString()));
mdBody.innerHTML = sanitize(marked.parse(readFileSync(mdFile).toString()), {});
}

function setBody(mdBody: HTMLElement, mdHeader: HTMLElement, mdFile: string, mdArticle: HTMLElement) {
Expand Down
6 changes: 3 additions & 3 deletions sources/code/renderer/preload/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ function generateSettings(optionsGroups: htmlConfig) {
const pDesc = document.createElement("p");
const formContainer = document.createElement("form");

h2.innerHTML = sanitize(setting.name);
h2.innerHTML = sanitize(setting.name, {});
pDesc.classList.add("description");
pDesc.innerHTML = sanitize(setting.description);
pDesc.innerHTML = sanitize(setting.description, {});
formContainer.classList.add("settingsContainer");

if("radio" in setting) {
Expand Down Expand Up @@ -152,7 +152,7 @@ function createForm(form:CheckBoxForm|RadioForm){
inputLabel.classList.add("disabled");
}
inputTag.addEventListener("change", fetchFromWebsite);
inputLabel.innerHTML = sanitize(form.label+(inputTag.title !== "" ? " 🛈" : ""));
inputLabel.innerHTML = sanitize(form.label+(inputTag.title !== "" ? " 🛈" : ""), {});
inputForm.appendChild(inputTag);
inputForm.appendChild(inputLabel);
return inputForm;
Expand Down

0 comments on commit b49ed33

Please sign in to comment.