-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
Improve issue autolinks #6273
Improve issue autolinks #6273
Changes from all commits
d731520
bb5338d
8f4dd55
aaab9df
102bcff
449f412
bee0d92
d17915b
2df42df
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -584,6 +584,8 @@ func RegisterRoutes(m *macaron.Macaron) { | |
Patch(reqToken(), reqRepoWriter(models.UnitTypeIssues, models.UnitTypePullRequests), bind(api.EditLabelOption{}), repo.EditLabel). | ||
Delete(reqToken(), reqRepoWriter(models.UnitTypeIssues, models.UnitTypePullRequests), repo.DeleteLabel) | ||
}) | ||
m.Post("/markdown", bind(api.MarkdownOption{}), misc.Markdown) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is an extra changes not related with the title. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry, I edited the description of the PR after the discussions above but didn't change the title. I can if you want. This is the same as above where the change is discussed here: https://github.com/go-gitea/gitea/pull/6273/files/102bcffcb6aa60c5bee1054d5c31daa483f2c0a0#discussion_r266227788 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah the issue is that in order to correctly render markdown issue links you need some context. The old |
||
m.Post("/markdown/raw", misc.MarkdownRaw) | ||
m.Group("/milestones", func() { | ||
m.Combo("").Get(repo.ListMilestones). | ||
Post(reqToken(), reqRepoWriter(models.UnitTypeIssues, models.UnitTypePullRequests), bind(api.CreateMilestoneOption{}), repo.CreateMilestone) | ||
|
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 the repo don't have external tracker, then just return nil. So why move it below?
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.
We don't return nil at all anymore, since we also want the metas if using the local issue tracker (for this specific case of checking to see what repo a user is in when writing an issue number and deciding how to link it). We should always want to have the username and repo name in context if possible because if not people are just scraping the URL for many of the HTML / Markdown processing functions which isn't accurate always.
These changes are discussed in detail in this comment by @zeripath if that helps: https://github.com/go-gitea/gitea/pull/6273/files/102bcffcb6aa60c5bee1054d5c31daa483f2c0a0#discussion_r266227788
Which is where a few of these commits come from.
I tried to edit the description of the to include that information as well, sorry if it was not clear.