Open lunny opened 1 year ago
Should also probably apply to the Markdown rendering in the Wiki pages.
Related: I found an issue with how links are rendered in the README.md view vs. the Wiki markdown view:
Given a Markdown link with the syntax [text](/h3xx/test-gitea-bug/raw/branch/main/README.md)
:
Suggested workaround (just for this issue): Always supply full link URL inside the Markdown.
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 theASTTransformer
struct and when get an image or link markdown, we can replace them. But currently, the renderer will output to anio.Writer
but goldmark creates tags via ast methods.Screenshots
No response