Skip to content

Feature request: Fancy styling of kbd tag #9242

Closed
@FWDekker

Description

@FWDekker
  • Gitea version (or commit ref): 1.10.0
  • Git version: 2.23.0
  • Operating system: FreeBSD
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist: N/A

Description

The <kbd> tag can be used to display a keyboard shortcut in HTML/Markdown. While it is similar to using backticks (`) to display code, some websites style it to appear like an actual button. For example, on GitHub the input <kbd>Ctrl + C</kbd> is rendered as Ctrl + C. I think this representation clearly indicates to readers that it's a keyboard shortcut rather than code.

To give an example of a real-world usage of <kbd>, consider the README of this repository of mine where I explain which shortcuts my program accepts.

I think Gitea should style <kbd> similar to how GitHub styles it, or should at the very least apply a monospace font to it.

Screenshots

The screenshots below show how the following snippet of markdown is rendered differently by GitHub than by Gitea.

Input

<kbd>Ctrl + C</kbd> vs `Ctrl + C`

Output (GitHub)

Rendering of above snipper by GitHub

Output (Gitea)

Rendering of above snippet by Gitea

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/proposalThe new feature has not been accepted yet but needs to be discussed first.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions