aboutsummaryrefslogtreecommitdiffstats
path: root/models/repo/repo.go
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2024-11-14 13:02:11 +0800
committerGitHub <noreply@github.com>2024-11-14 05:02:11 +0000
commit3f9c3e7bc394c115ccc4818d6505f1f68de350d2 (patch)
treee07e4a3dc07ce80104f7949af5cb180b7fce449e /models/repo/repo.go
parent985e2a8af3d6468bac3ab178148c38bdbd8414f5 (diff)
downloadgitea-3f9c3e7bc394c115ccc4818d6505f1f68de350d2.tar.gz
gitea-3f9c3e7bc394c115ccc4818d6505f1f68de350d2.zip
Refactor render system (#32492)
There were too many patches to the Render system, it's really difficult to make further improvements. This PR clears the legacy problems and fix TODOs. 1. Rename `RenderContext.Type` to `RenderContext.MarkupType` to clarify its usage. 2. Use `ContentMode` to replace `meta["mode"]` and `IsWiki`, to clarify the rendering behaviors. 3. Use "wiki" mode instead of "mode=gfm + wiki=true" 4. Merge `renderByType` and `renderByFile` 5. Add more comments ---- The problem of "mode=document": in many cases it is not set, so many non-comment places use comment's hard line break incorrectly
Diffstat (limited to 'models/repo/repo.go')
-rw-r--r--models/repo/repo.go2
1 files changed, 0 insertions, 2 deletions
diff --git a/models/repo/repo.go b/models/repo/repo.go
index 68f8e16a21..4776ff0b9c 100644
--- a/models/repo/repo.go
+++ b/models/repo/repo.go
@@ -479,7 +479,6 @@ func (repo *Repository) ComposeMetas(ctx context.Context) map[string]string {
metas := map[string]string{
"user": repo.OwnerName,
"repo": repo.Name,
- "mode": "comment",
}
unit, err := repo.GetUnit(ctx, unit.TypeExternalTracker)
@@ -521,7 +520,6 @@ func (repo *Repository) ComposeDocumentMetas(ctx context.Context) map[string]str
for k, v := range repo.ComposeMetas(ctx) {
metas[k] = v
}
- metas["mode"] = "document"
repo.DocumentRenderingMetas = metas
}
return repo.DocumentRenderingMetas