-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use Markdowneditor in more places #27772
base: main
Are you sure you want to change the base?
Conversation
While working on this I found out, that the Markdown in Projects descriptions on the User/Org level is not rendered. I fixed this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apart from below LGTM
@JakobDev please fix the merge conflicts. 🍵 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is necessary. Since user/org supports .profile, we don't need to support markdown on their descriptions. And for project description, they will be displayed on the list of projects, I think formating with markdown on a project list page will disturb many people.
@lunny these places already support Markdown, only their editor indicates otherwise as far as I understood |
@lunny so, what do we do about this PR? |
Actually usually I also tried to help & push some PRs to move on. The problem is that many PRs are inactive and not that responsive, for example, So usually I would like to spend time on PRs that are more active. ps: there are still some problems in this PR I guess ....... Update: I merged main into this PR and resolved the conflicts. But there are still some problems in code, I am not sure whether the author is still interested in this PR. |
Could you give an example what we need to fix? |
@@ -137,6 +137,10 @@ func RenderNewProject(ctx *context.Context) { | |||
ctx.Data["CardTypes"] = project_model.GetCardConfig() | |||
ctx.Data["CanWriteProjects"] = ctx.Repo.Permission.CanWrite(unit.TypeProjects) | |||
ctx.Data["CancelLink"] = ctx.Repo.Repository.Link() + "/projects" | |||
ctx.Data["ProjectMarkdownPreviewURL"] = fmt.Sprintf("%s/markup", ctx.Repo.Repository.Link()) | |||
ctx.Data["ProjectMarkdownPreviewContext"] = ctx.Repo.Repository.Link() | |||
ctx.Data["ProjectMarkdownPreviewMode"] = "comment" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here and other places: the mode shouldn't be "comment" because the description is rendered in original markdown format
@@ -974,6 +974,8 @@ func registerRoutes(m *web.Router) { | |||
// end "/repo": create, migrate, search | |||
|
|||
m.Group("/{username}/-", func() { | |||
m.Post("/markup", web.Bind(structs.MarkupOption{}), misc.Markup) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be placed under /-/markup
because it doesn't really belong to "user"
|
||
if (markdownEditor.length > 0) { | ||
initComboMarkdownEditor(markdownEditor[0]); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there are more than one editors, only the first one gets initialized.
Added some quick reviews (haven't reviewed it carefully yet, maybe I could checkout and edit directly if this PR gets enough interests). |
Inspired by #27759
There are places in Gitea which support rendering markdown, but instead of the Markdowneditor the normal Editor is used. This PR fixes this.
It includes the following things:
Please tell me, if I missed something.
Screenshots