Revert HTML tag escaping

Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
This commit is contained in:
Sebastian Martinez
2023-06-30 10:01:14 +02:00
committed by Rūdolfs Ošiņš
parent 8ef8ce5b81
commit c04d399cf3
6 changed files with 12 additions and 33 deletions
+2 -4
View File
@@ -2,14 +2,13 @@
import dompurify from "dompurify";
import { marked } from "marked";
import { renderer, walkTokens } from "@app/lib/markdown";
import { renderer } from "@app/lib/markdown";
import { twemoji } from "@app/lib/utils";
export let content: string;
export let fontSize: "tiny" | "small" | "medium" = "small";
marked.use({
walkTokens,
renderer,
// TODO: Disables deprecated options, remove once removed from marked
mangle: false,
@@ -17,8 +16,7 @@
});
const render = (content: string): string =>
// eslint-disable-next-line @typescript-eslint/naming-convention
dompurify.sanitize(marked.parseInline(content), { SANITIZE_DOM: false });
dompurify.sanitize(marked.parseInline(content));
</script>
<style>
+1 -4
View File
@@ -12,7 +12,6 @@
import {
markdownExtensions as extensions,
renderer,
walkTokens,
} from "@app/lib/markdown";
import { updateProjectRoute } from "@app/views/projects/router";
@@ -27,7 +26,6 @@
);
marked.use({
extensions,
walkTokens,
renderer,
// TODO: Disables deprecated options, remove once removed from marked
mangle: false,
@@ -37,8 +35,7 @@
let container: HTMLElement;
const render = (content: string): string =>
// eslint-disable-next-line @typescript-eslint/naming-convention
dompurify.sanitize(marked.parse(content), { SANITIZE_DOM: false });
dompurify.sanitize(marked.parse(content));
function navigateToMarkdownLink(event: any) {
if (event.target.matches(".file-link")) {