HTML tags in repository description #1122
Labels
No labels
accessibility
bug
bug
infrastructure
Codeberg
contributions welcome
docs
duplicate
enhancement
infrastructure
legal
licence / ToS
please chill
we are volunteers
public relations
question
question
user support
s/Forgejo
s/Forgejo/migration
s/Pages
s/Weblate
s/Woodpecker
security
service
upstream
wontfix
No milestone
No project
No assignees
5 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Codeberg/Community#1122
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Many HTML tags are unnecessarily supported in repository description. Check https://codeberg.org/Peaksol/html_tags_test to see how rich the description text could be.
I guess it's okay to support a limited number of HTML tags, such as
<a>for external links, and<img>for some little shields like "No GitHub".The description is also shown on the personal profile page (https://codeberg.org/Peaksol), so you can see what a disaster it would be if all the HTML tags work.
Additionally, the page title for repos with rich text description is problematic. You can hover on the browser tab to see all those HTML tags in a mess. Guess it's also not good for SEO and stuff.
Oh wow … I think we reported it already, and my example broke (but I think I was using markdown formatting not HTML). Looks like the markdown formatting was removed, but HTML still works?
This could be a problem, we have many of those repositories that those little neat badges that just work - if images are banned, then those shields would be banned as well!
Oh wow, this isn't nice.
Upstream issue: forgejo/forgejo#1202
To be honest I don't think they should be allowed in the repo description. The Readme is the place for that. But if we did want them I guess one way to somewhat limit the impact of abuse would be to set a maximum size for the description container with
overflow: hidden.My preference would be to allow basic markdown (bold, italic, and links) and nothing else.
Couldn't we technically also set a max-size on the image elements itself?
An post processer can be added for that.
I guess something like
might work. But an inline style with
!importantmight still override it I think. Maybe we can filter!importantout of inline styles though (if we allow them at all – see forgejo/forgejo#1183).Alternatively we could do some post-processing as @Gusted suggest but it might be quite complex.