Skip to content

Commit

Permalink
showdown to marked
Browse files Browse the repository at this point in the history
change from shown to marked due library security issues
  • Loading branch information
alloylab committed Feb 8, 2024
1 parent 99d9e2f commit 48dcc31
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 6 deletions.
3 changes: 2 additions & 1 deletion src/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
],
"js": [
"vendor/jquery.min.js",
"vendor/showdown.min.js",
"vendor/purify.min.js",
"vendor/marked.min.js",
"cleanup/script.js",
"notes/script.js"
]
Expand Down
3 changes: 1 addition & 2 deletions src/notes/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ const notesObserver = new MutationObserver(function () {
let content = note.html().replace(/&lt;/g, '<').replace(/&gt;/g, '>')
.replace(/<\bspan\b>/g, '').replace(/<\/\bspan\b>/g, '').trim();

let converter = new showdown.Converter();
let markdown = converter.makeHtml(content);
let markdown = DOMPurify.sanitize(marked.parse(content));
$(this).replaceWith(markdown);
});
}
Expand Down
6 changes: 6 additions & 0 deletions src/vendor/marked.min.js

Large diffs are not rendered by default.

Loading

0 comments on commit 48dcc31

Please sign in to comment.