diff options
author | guillep2k <18600385+guillep2k@users.noreply.github.com> | 2019-11-18 10:13:07 -0300 |
---|---|---|
committer | Lauris BH <lauris@nix.lv> | 2019-11-18 15:13:07 +0200 |
commit | b15f26b1cf3dc976ae400d4a3c73ec3bd4a50bc6 (patch) | |
tree | 14e4b0e743605f25da792c96c6deb2d5e8200155 /modules/markup/html.go | |
parent | 08ae6bb7edb9582c38edb8a0dba1b1be10fb00fc (diff) | |
download | gitea-b15f26b1cf3dc976ae400d4a3c73ec3bd4a50bc6.tar.gz gitea-b15f26b1cf3dc976ae400d4a3c73ec3bd4a50bc6.zip |
Close/reopen issues by keywords in titles and comments (#8866)
* Add close/reopen from comment functionality
* Fix comment
* Rewrite closing/reopening template
* Check xref permissions, move action to services/pull
* Fix RefIsPull field
* Add xref tests
* Fix xref unique filter
* Only highlight keywords for actionable xrefs
* Fix xref neuter filter
* Fix check return status
* Restart CI
Diffstat (limited to 'modules/markup/html.go')
-rw-r--r-- | modules/markup/html.go | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/modules/markup/html.go b/modules/markup/html.go index 1ff7a41cbb..924d0089a5 100644 --- a/modules/markup/html.go +++ b/modules/markup/html.go @@ -659,8 +659,16 @@ func issueIndexPatternProcessor(ctx *postProcessCtx, node *html.Node) { return } - // Decorate action keywords - keyword := createKeyword(node.Data[ref.ActionLocation.Start:ref.ActionLocation.End]) + // Decorate action keywords if actionable + var keyword *html.Node + if references.IsXrefActionable(ref.Action) { + keyword = createKeyword(node.Data[ref.ActionLocation.Start:ref.ActionLocation.End]) + } else { + keyword = &html.Node{ + Type: html.TextNode, + Data: node.Data[ref.ActionLocation.Start:ref.ActionLocation.End], + } + } spaces := &html.Node{ Type: html.TextNode, Data: node.Data[ref.ActionLocation.End:ref.RefLocation.Start], |