From 93eedfea3570e7804313f2f8038ae600e33d4e57 Mon Sep 17 00:00:00 2001 From: silverwind Date: Wed, 27 Mar 2024 19:53:38 +0100 Subject: [PATCH 1/2] Render code tags in commit messages --- modules/templates/util_render.go | 4 ++-- web_src/css/base.css | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/templates/util_render.go b/modules/templates/util_render.go index 7ed3a8b9b49d8..d1c9b082fab00 100644 --- a/modules/templates/util_render.go +++ b/modules/templates/util_render.go @@ -41,7 +41,7 @@ func RenderCommitMessage(ctx context.Context, msg string, metas map[string]strin if len(msgLines) == 0 { return template.HTML("") } - return template.HTML(msgLines[0]) + return RenderCodeBlock(template.HTML(msgLines[0])) } // RenderCommitMessageLinkSubject renders commit message as a XSS-safe link to @@ -68,7 +68,7 @@ func RenderCommitMessageLinkSubject(ctx context.Context, msg, urlDefault string, log.Error("RenderCommitMessageSubject: %v", err) return template.HTML("") } - return template.HTML(renderedMessage) + return RenderCodeBlock(template.HTML(renderedMessage)) } // RenderCommitBody extracts the body of a commit message without its title. diff --git a/web_src/css/base.css b/web_src/css/base.css index 07f15cac2b33c..ada3dbf18f3a4 100644 --- a/web_src/css/base.css +++ b/web_src/css/base.css @@ -294,7 +294,7 @@ a.label, .inline-code-block { padding: 2px 4px; border-radius: var(--border-radius-medium); - background-color: var(--color-markup-code-block); + background-color: var(--color-label-bg); } /* fix Fomantic's line-height cutting off "g" on Windows Chrome with Segoe UI */ From b58186e382683acd152f1c9ead39e87605787496 Mon Sep 17 00:00:00 2001 From: silverwind Date: Wed, 27 Mar 2024 20:33:18 +0100 Subject: [PATCH 2/2] use em-based border-radius --- web_src/css/base.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web_src/css/base.css b/web_src/css/base.css index ada3dbf18f3a4..1f7f9e057d1f7 100644 --- a/web_src/css/base.css +++ b/web_src/css/base.css @@ -293,7 +293,7 @@ a.label, .inline-code-block { padding: 2px 4px; - border-radius: var(--border-radius-medium); + border-radius: .24em; background-color: var(--color-label-bg); }