mirror of
https://github.com/go-gitea/gitea.git
synced 2026-09-27 16:04:17 +00: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>
16 lines
437 B
TypeScript
16 lines
437 B
TypeScript
import type {FrontendRenderFunc} from '../plugin.ts';
|
|
import {initSwaggerUI} from '../swagger.ts';
|
|
|
|
// HINT: SWAGGER-CSS-IMPORT: these styles are for the render only.
|
|
import '../../../css/swagger-render.css';
|
|
|
|
export const frontendRender: FrontendRenderFunc = (opts) => {
|
|
try {
|
|
initSwaggerUI(opts.container, {specText: opts.contentString()});
|
|
return true;
|
|
} catch (error) {
|
|
console.error(error);
|
|
return false;
|
|
}
|
|
};
|