From 3e2bba08035136a43786db47ba69a37d19b06304 Mon Sep 17 00:00:00 2001 From: parnic Date: Fri, 29 Apr 2022 04:30:54 -0500 Subject: [PATCH] Fix Pull Request comment filename word breaks (#19535) * Fix word breaks in Chrome This fixes word wrapping on the filename for a comment on a PR. A previous commit fixed this problem in Firefox, but not Chrome. Fixes #16248 * Don't break Outdated badge This prevents the Outdated badge on a PR from wrapping in the middle of the word for a comment on a long filename. * Move word break to recommended element * Add overflow-wrap per PR review * Update web_src/less/helpers.less Co-authored-by: silverwind Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: Lunny Xiao --- templates/repo/issue/view_content/comments.tmpl | 4 ++-- web_src/less/helpers.less | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/templates/repo/issue/view_content/comments.tmpl b/templates/repo/issue/view_content/comments.tmpl index 7b0941148f..7c4e63314d 100644 --- a/templates/repo/issue/view_content/comments.tmpl +++ b/templates/repo/issue/view_content/comments.tmpl @@ -505,13 +505,13 @@ {{ range $filename, $lines := .Review.CodeComments}} {{range $line, $comms := $lines}}
-
+
{{$invalid := (index $comms 0).Invalidated}} {{$resolved := (index $comms 0).IsResolved}} {{$resolveDoer := (index $comms 0).ResolveDoer}} {{$isNotPending := (not (eq (index $comms 0).Review.Type 0))}}
- {{$filename}} + {{$filename}} {{if $invalid }} {{$.i18n.Tr "repo.issues.review.outdated"}} diff --git a/web_src/less/helpers.less b/web_src/less/helpers.less index 6904083da8..0c4bf1753a 100644 --- a/web_src/less/helpers.less +++ b/web_src/less/helpers.less @@ -27,6 +27,8 @@ .word-break { word-wrap: break-word !important; + word-break: break-word; /* compat: Safari */ + overflow-wrap: anywhere; } .ellipsis {