Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion front/assets/js/flaky_tests/components/actions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import * as types from "../types";
import { auto } from "@popperjs/core";
import { Headers } from "../network/request";
import * as marked from "marked";
import DOMPurify from "dompurify";

export const Actions = ({ item }: { item: FlakyTestItem, }) => {
const config = useContext(stores.Config.Context);
Expand Down Expand Up @@ -157,7 +158,18 @@ const TicketDetail = (props: TicketDetailProps) => {
**Commit**: ${props.item.latestDisruptionSha()}

**File**: ${props.item.testFile}`;
return marked.parse(markdown);

const rawHtml = marked.parse(markdown);
return DOMPurify.sanitize(rawHtml, {
ALLOWED_TAGS: [
`h1`, `h2`, `h3`, `h4`, `h5`, `h6`,
`p`, `br`, `strong`, `em`, `u`, `strike`,
`ul`, `ol`, `li`,
`blockquote`, `code`, `pre`
],
ALLOWED_ATTR: [`title`],
ALLOWED_SCHEMES: [`http`, `https`, `mailto`]
});
};


Expand Down