mirror of
https://github.com/go-gitea/gitea
synced 2025-07-04 01:27:20 +00:00
8
web_src/js/utils/html.test.ts
Normal file
8
web_src/js/utils/html.test.ts
Normal file
@ -0,0 +1,8 @@
|
||||
import {html, htmlEscape, htmlRaw} from './html.ts';
|
||||
|
||||
test('html', async () => {
|
||||
expect(html`<a>${'<>&\'"'}</a>`).toBe(`<a><>&'"</a>`);
|
||||
expect(html`<a>${htmlRaw('<img>')}</a>`).toBe(`<a><img></a>`);
|
||||
expect(html`<a>${htmlRaw`<img ${'&'}>`}</a>`).toBe(`<a><img &></a>`);
|
||||
expect(htmlEscape(`<a></a>`)).toBe(`<a></a>`);
|
||||
});
|
Reference in New Issue
Block a user