diff --git a/app/src/history/history.ts b/app/src/history/history.ts index d1c2b5c3b..b07eb8321 100644 --- a/app/src/history/history.ts +++ b/app/src/history/history.ts @@ -7,7 +7,7 @@ import {Protyle} from "../protyle"; import {disabledProtyle, onGet} from "../protyle/util/onGet"; import * as dayjs from "dayjs"; import {fetchPost} from "../util/fetch"; -import {escapeHtml} from "../util/escape"; +import {escapeAttr, escapeHtml} from "../util/escape"; import {isMobile} from "../util/functions"; import {showDiff} from "./diff"; import {setStorageVal} from "../protyle/util/compatibility"; @@ -432,7 +432,7 @@ export const openHistory = () => { iconElement.classList.add("b3-list-item__arrow--open"); let html = ""; response.data.items.forEach((docItem: { title: string, path: string }) => { - html += `
  • + html += `
  • ${escapeHtml(docItem.title)} diff --git a/app/src/util/escape.ts b/app/src/util/escape.ts index dfb261845..b1f15839b 100644 --- a/app/src/util/escape.ts +++ b/app/src/util/escape.ts @@ -1,3 +1,7 @@ export const escapeHtml = (html: string) => { return html.replace(/&/g, "&").replace(/ { + return html.replace(/"/g, """).replace(/'/g, "'"); +};