Skip to content

Different behaviors when generating Markdown links for headings containing punctuations and other symbols #19745

Closed
@federico-ntr

Description

@federico-ntr

Description

When you use double quotes in a heading, Gitea removes them from the reference link.

Example:

If you use a header with double quotes like:

## Header with "double quotes"

Gitea generated link to that header is <URL>#header-with-double-quotes instead of <URL>#header-with-"double-quotes".
This behaviour leads to inconsistency between renderers, even between those which follow CommonMark specs. For example VSCode's Markdown preview (which follows CommonMark specs) keeps the double quotes in the links.

I reproduced the issue here

Gitea Version

1.16.8

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

No response

Git Version

Irrelevant

Operating System

Ubuntu 20.04

How are you running Gitea?

The instance runs on a virtual machine without containerization. I don't know which DB is used since I didn't installed it myself. By the way I don't think it's relevant here.

Database

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue/needs-feedbackFor bugs, we need more details. For features, the feature must be described in more detailoutdated/theme/markdowntype/upstreamThis is an issue in one of Gitea's dependencies and should be reported there

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions