1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-11 21:17:19 +00:00

Refactor frontend unique id & comment (#34958)

* there is no bug of the "unique element id", but duplicate code, this
PR just merges the duplicate "element id" logic and move the function
from "fomaintic" to "dom"
* improve comments
* make "git commit graph" page update pagination links correctly
This commit is contained in:
wxiaoguang
2025-07-05 23:21:53 +08:00
committed by GitHub
parent 6033c67a1a
commit c05082669b
7 changed files with 30 additions and 35 deletions

View File

@ -17,7 +17,7 @@ export function html(tmpl: TemplateStringsArray, ...parts: Array<any>): string {
let output = tmpl[0];
for (let i = 0; i < parts.length; i++) {
const value = parts[i];
const valueEscaped = (value instanceof rawObject) ? value.toString() : htmlEscape(String(parts[i]));
const valueEscaped = (value instanceof rawObject) ? value.toString() : htmlEscape(String(value));
output = output + valueEscaped + tmpl[i + 1];
}
return output;