diff options
author | silverwind <me@silverwind.io> | 2020-11-04 08:14:07 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-04 09:14:07 +0200 |
commit | 62719cdd2d7e62cd21f4bfcf8eb9ded37128159a (patch) | |
tree | 402d8c20f9e3f40eb2c6c695a45a3dd3497a2376 /routers | |
parent | 951a3337336d96e363776d874e5a844e0c768f3b (diff) | |
download | gitea-62719cdd2d7e62cd21f4bfcf8eb9ded37128159a.tar.gz gitea-62719cdd2d7e62cd21f4bfcf8eb9ded37128159a.zip |
Fix whitespace rendering in diff (#13415)
- Introduce new .code-inner class that sets the CSS attributes on
rendered code lines like view,blame and diff.
- Rename .wrap class to .word-break to reflect what it actually does
- Remove .raw which was only used on webhook page
- Set white-space: pre-wrap except on blame where it can break the
layout
Fixes: https://github.com/go-gitea/gitea/issues/13406
Diffstat (limited to 'routers')
-rw-r--r-- | routers/repo/blame.go | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/routers/repo/blame.go b/routers/repo/blame.go index 69becc50d4..812c55ea4d 100644 --- a/routers/repo/blame.go +++ b/routers/repo/blame.go @@ -237,6 +237,7 @@ func renderBlame(ctx *context.Context, blameParts []git.BlamePart, commitNames m } fileName := fmt.Sprintf("%v", ctx.Data["FileName"]) line = highlight.Code(fileName, line) + line = `<code class="code-inner">` + line + `</code>` if len(part.Lines)-1 == index && len(blameParts)-1 != pi { codeLines.WriteString(fmt.Sprintf(`<li class="L%d bottom-line" rel="L%d">%s</li>`, i, i, line)) } else { |