refactor: clean up pull request comment related code and template dict (#39789)

1. drop comment.commit_id
2. refactor templates, remove `dict "." .` from templates
This commit is contained in:
wxiaoguang authored and GitHub committed 2026-10-15 23:09:41 +00:00
1 parent 1c117a9352
commit 222136ee71
28 files changed
+321 -266

No files matched your search

+6 -5
View File
@@ -142,12 +142,13 @@ const (
MaxFullFileHighlightTimeLimit = 2 * time.Second
)
// GetType returns the type of DiffLine.
func (d *DiffLine) GetType() int {
return int(d.Type)
}
func (d *DiffLine) IsDiffLinePlain() bool { return d.Type == DiffLinePlain }
func (d *DiffLine) IsDiffLineAdd() bool { return d.Type == DiffLineAdd }
func (d *DiffLine) IsDiffLineDel() bool { return d.Type == DiffLineDel }
func (d *DiffLine) IsDiffLineSection() bool { return d.Type == DiffLineSection }
// GetHTMLDiffLineType returns the diff line type name for HTML
// GetHTMLDiffLineType returns the diff line type name for HTML,
// it will generate CSS names for styles ".del-code", ".add-code", ".same-code", ".tag-code"
func (d *DiffLine) GetHTMLDiffLineType() string {
switch d.Type {
case DiffLineAdd: