deno.land / x / esm@v135_2 / test / sanitize-html / sanitize-html.test.ts

sanitize-html.test.ts
نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import { assertEquals } from "https://deno.land/std@0.180.0/testing/asserts.ts";
import sanitizeHtml from "http://localhost:8080/sanitize-html@2.7.0";
Deno.test("sanitize-html", () => { const rawHtml = `<script>location.href="https://boom.com"</script><h1>Hello world!</h1>`; const html = sanitizeHtml(rawHtml, { allowedTags: sanitizeHtml.defaults.allowedTags, allowedAttributes: sanitizeHtml.defaults.allowedAttributes, }); assertEquals( html, `<h1>Hello world!</h1>`, );});
esm

Version Info

Tagged at
a year ago