Skip to content

backtick math #27602

Closed
Closed
@nschloe

Description

@nschloe

Feature Description

GitLab and GitHub both have support for backtick math, i.e.,

The Pythagorean theorem can be written as an equation
relating the lengths of the sides $`a`$, $`b`$ and the
hypotenuse $`c`$:

```math
a^2 + b^2 = c^2.
```

The Pythagorean theorem can be written as an equation relating the lengths of the sides $a$, $b$ and the hypotenuse $c$:

$$a^2 + b^2 = c^2.$$

The backticks avoid problems with accidental markdown sanitation in math content (which causes many problems for GitHub). The backticks suggests to the sanitizer that this is "code", not be touched.

GitLab started out with only the backticked mode in 2016. (They've added an imperfect dollar mode now.)

Right now, Gitea has no proper support for backticked math. Inline backticks

$`a + b = c`$

are literally rendered as backticks,

screenshot_2023-10-13-141058

and display-block backticks are rendered, but not centralized:

```math
abc
```

$$
abc
$$

screenshot_2023-10-13-141140

Using backticks in math also has the advantage that other Markdown software, e.g., linters or formatters, can be run on the file without modification.

It'd be great if Gitea could support backticked math as well.

Edit: I've surveyed math syntaxes and performance on GitHub, Gitea, GitLab.. Gitea's bracket-syntax is unique and hence not compatible. The backticked syntax is sorely missing from Gitea, especially given its great performance on the other platforms.

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