mirror of
https://github.com/go-gitea/gitea.git
synced 2026-09-26 23:56:37 +09:00
857d3d3df3
Update eslint and its plugins, enable more rules and fix their findings: 1. `unicorn/no-unsafe-string-replacement` found that uploading a file whose name contains `$&` inserted a broken markdown link, because `String#replace` expands such patterns in the replacement string 2. `@typescript-eslint/require-await` removes `async` from functions that never await 3. Plugin rules not covered by a preset are now listed explicitly --------- Co-authored-by: bircni <bircni@icloud.com>
9 lines
357 B
TypeScript
9 lines
357 B
TypeScript
import {html, htmlEscape, htmlRaw} from './html.ts';
|
|
|
|
test('html', () => {
|
|
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>`);
|
|
});
|