Skip to content

Extend markdown links with renderers #26195

Closed
@lunny

Description

@lunny

Feature Description

This proposal is inspired by #26190 and extends to all markdown rendering.

Background

Currently, Gitea has many renderers even supported third-party renderers. All these renderers will be used in Git file view, including LFS files. They can render PDFs, SVGs, CSV, asciinema, console log and many others.

Purpose

If these renderers could be used in all markdown syntax, it would be good. Then we can use them in issues, comments, wikis, and other places which support markdown syntax.

How to

Both plain internal links and markdown image internal links could invoke renderers to render the content. According to the file name extension names stored in databases or in git path, we can get to know the file type and which renderer should be chosen.

Difficulties

We can change goldmark.go and the ASTTransformer struct and when get an image or link markdown, we can replace them. But currently, the renderer will output to an io.Writer but goldmark creates tags via ast methods.

Screenshots

No response

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