fix 235221: Passing the markdown content to the webview via meta tag and purifying it before use

This commit is contained in:
Parasaran
2024-12-17 22:57:12 +05:30
parent 68410e1431
commit da1d8b9c8e
2 changed files with 8 additions and 2 deletions

View File

@@ -353,6 +353,12 @@ document.addEventListener('click', event => {
}
}, true);
window.addEventListener('load', () => {
const htmlParser = new DOMParser();
const markDownHtml = htmlParser.parseFromString(getData('data-md-content'), 'text/html');
document.body.appendChild(markDownHtml.body);
});
window.addEventListener('scroll', throttle(() => {
updateScrollProgress();