Revert "fix: harden automatic mobile boards"
This reverts commit d0b9348b86.
This commit is contained in:
1 parent
967ed8dd73
commit
e93293f8a9
22 files changed
+69
-491
No files matched your search
@@ -1,12 +0,0 @@
|
||||
import { describe, expect, test } from "vitest";
|
||||
|
||||
import { sanitizeFeedDescription } from "./sanitize-description";
|
||||
|
||||
describe("sanitizeFeedDescription", () => {
|
||||
test("keeps basic formatting while removing executable markup", () => {
|
||||
const description =
|
||||
'<p onclick="alert(1)" aria-hidden="true" data-tracking="yes">News <strong>today</strong><script>alert(2)</script><img src="tracker"></p>';
|
||||
|
||||
expect(sanitizeFeedDescription(description)).toBe("<p>News <strong>today</strong></p>");
|
||||
});
|
||||
});
|
||||
@@ -1,11 +0,0 @@
|
||||
import { sanitize } from "isomorphic-dompurify";
|
||||
|
||||
const allowedDescriptionTags = ["b", "br", "em", "i", "li", "ol", "p", "s", "strong", "u", "ul"];
|
||||
|
||||
export const sanitizeFeedDescription = (description: string) =>
|
||||
sanitize(description, {
|
||||
ALLOW_ARIA_ATTR: false,
|
||||
ALLOW_DATA_ATTR: false,
|
||||
ALLOWED_ATTR: [],
|
||||
ALLOWED_TAGS: allowedDescriptionTags,
|
||||
});
|
||||
Reference in new issue
Block a user