Hi наб,
it seems like the layout got somewhat messed up:
https://s2.imghost.eu/2020/09/17/Screenshot-at-2020-09-17-19-35-34.png
Testrepo shows the same behaviour:
https://git.sr.ht/~rwa/testrepo
https://git.sr.ht/~rwa/testrepo/tree/master/symlink.md?view-source
René
On Thu, Sep 17, 2020 at 08:15:09PM +0200, René Wagner wrote:
> it seems like the layout got somewhat messed up:
> https://s2.imghost.eu/2020/09/17/Screenshot-at-2020-09-17-19-35-34.png
Confirmed, thanks; it looked fine in Lynx, I hadn't tested with a normal
browser; see below for scissor-patch that wraps this in the right
elements to get it laid out properly.
-- >8 --
From: =?UTF-8?q?=D0=BD=D0=B0=D0=B1?= <nabijaczleweli@nabijaczleweli.xyz>
Subject: [PATCH git.sr.ht] Wrap symlink content properly for layout
---
gitsrht/blueprints/repo.py | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/gitsrht/blueprints/repo.py b/gitsrht/blueprints/repo.py
index c1c5013..aa17ec1 100644
--- a/gitsrht/blueprints/repo.py+++ b/gitsrht/blueprints/repo.py
@@ -57,9 +57,10 @@ def get_readme(repo, git_repo, tip, link_prefix=None):
def _highlight_file(repo, ref, entry, data, blob_id, commit_id):
link_prefix = url_for('repo.tree', owner=repo.owner,
repo=repo.name, ref=ref)
- if entry.filemode == pygit2.GIT_FILEMODE_LINK:- return Markup(f"<a href=\"{url_quote(data.encode('utf-8'))}\">" +- f"{escape(data)}</a>")+ if blob.filemode == pygit2.GIT_FILEMODE_LINK:+ return Markup("<div class=\"highlight\"><pre>" ++ f"<a href=\"{url_quote(data.encode('utf-8'))}\">" ++ f"{escape(data)}</a><pre></div>") else:
return get_highlighted_file("git.sr.ht:git", entry.name, blob_id, data)
--
2.20.1