Skip to content

Commit d8cce3f

Browse files
committed
markup.ComposeSimpleDocumentMetas
1 parent 0ec5c4a commit d8cce3f

File tree

5 files changed

+7
-4
lines changed

5 files changed

+7
-4
lines changed

modules/markup/render.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,3 +227,7 @@ func Init(ph *ProcessorHelper) {
227227
}
228228
}
229229
}
230+
231+
func ComposeSimpleDocumentMetas() map[string]string {
232+
return map[string]string{"markdownLineBreakStyle": "document"}
233+
}

modules/templates/util_render.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ func reactionToEmoji(reaction string) template.HTML {
210210
func (ut *RenderUtils) MarkdownToHtml(input string) template.HTML { //nolint:revive
211211
output, err := markdown.RenderString(&markup.RenderContext{
212212
Ctx: ut.ctx,
213-
Metas: map[string]string{"mode": "document"},
213+
Metas: markup.ComposeSimpleDocumentMetas(),
214214
}, input)
215215
if err != nil {
216216
log.Error("RenderString: %v", err)

modules/templates/util_render_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ var testMetas = map[string]string{
5050
"user": "user13",
5151
"repo": "repo11",
5252
"repoPath": "../../tests/gitea-repositories-meta/user13/repo11.git/",
53-
"mode": "comment",
5453
}
5554

5655
func TestMain(m *testing.M) {

routers/web/org/home.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ func prepareOrgProfileReadme(ctx *context.Context, viewRepositories bool) bool {
189189
Base: profileDbRepo.Link(),
190190
BranchPath: path.Join("branch", util.PathEscapeSegments(profileDbRepo.DefaultBranch)),
191191
},
192-
Metas: map[string]string{"mode": "document"},
192+
Metas: markup.ComposeSimpleDocumentMetas(),
193193
}, bytes); err != nil {
194194
log.Error("failed to RenderString: %v", err)
195195
} else {

routers/web/shared/user/header.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ func PrepareContextForProfileBigAvatar(ctx *context.Context) {
5050
ctx.Data["OpenIDs"] = openIDs
5151
if len(ctx.ContextUser.Description) != 0 {
5252
content, err := markdown.RenderString(&markup.RenderContext{
53-
Metas: map[string]string{"mode": "document"},
53+
Metas: markup.ComposeSimpleDocumentMetas(),
5454
Ctx: ctx,
5555
}, ctx.ContextUser.Description)
5656
if err != nil {

0 commit comments

Comments
 (0)