mirror of
https://github.com/go-gitea/gitea
synced 2025-07-03 09:07:19 +00:00
9 lines
363 B
TypeScript
9 lines
363 B
TypeScript
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>`);
|
|
});
|