Skip to content

Commit

Permalink
Support autolink url with comment (mattermost#773)
Browse files Browse the repository at this point in the history
  • Loading branch information
kitty committed Nov 2, 2021
1 parent c4fd985 commit 4db5740
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions server/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -367,14 +367,9 @@ func (p *Plugin) AddAutolinks(key, baseURL string) error {
Template: `[` + key + `-${jira_id}](` + baseURL + `/browse/` + key + `-${jira_id})`,
},
{
DisableNonWordPrefix: false,
DisableNonWordSuffix: false,
Disabled: false,
Name: "jirajumptocomment",
Pattern: `(?P<IssueKey>[A-Za-z]+-[0-9]+)[?]focusedCommentId[^\\s]+`,
Scope: nil,
Template: `[${IssueKey} Link to comment]($0)`,
WordMatch: false,
Name: key + " jump to comment for " + baseURL,
Pattern: `(` + strings.ReplaceAll(baseURL, ".", `\.`) + `/browse/)(` + key + `)(-)(?P<jira_id>\d+)[?](focusedCommentId)(=)(?P<comment_id>\d+)`,
Template: `[` + key + `-${jira_id} With Focused Comment($comment_id)](` + baseURL + `/browse/` + key + `-${jira_id}?focusedCommentId=$comment_id)`,
},
}

Expand Down

0 comments on commit 4db5740

Please sign in to comment.