forgejo/modules
Hester Gong ca905b82df
Append (comment) when a link points at a comment rather than the whole issue (#23734)
Close #23671 

For the feature mentioned above, this PR append ' (comment)' to the
rendered html if it is a hashcomment.
After the PR, type in the following

```
pull request from other repo:
http://localhost:3000/testOrg/testOrgRepo/pulls/2

pull request from this repo:
http://localhost:3000/aaa/testA/pulls/2

issue comment from this repo:
http://localhost:3000/aaa/testA/issues/1#issuecomment-18

http://localhost:3000/aaa/testA/pulls/2#issue-9

issue comment from other repo:
http://localhost:3000/testOrg/testOrgRepo/pulls/2#issuecomment-24

http://localhost:3000/testOrg/testOrgRepo/pulls/2#issue
```
Gives:
<img width="687" alt="截屏2023-03-27 13 53 06"
src="https://user-images.githubusercontent.com/17645053/227852387-2b218e0d-3468-4d90-ad81-d702ddd17fd2.png">



Other than the above feature, this PR also includes two other changes:

1 Right now, the render of links from file changed tab in pull request
might not be very proper, for example, if type in the following. (not
sure if this is an issue or design, if not an issue, I will revert the
changes). example on
[try.gitea.io](https://try.gitea.io/HesterG/testrepo/pulls/1)
```
https://try.gitea.io/HesterG/testrepo/pulls/1/files#issuecomment-162725
https://try.gitea.io/HesterG/testrepo/pulls/1/files
```
it will render the following 
<img width="899" alt="截屏2023-03-24 15 41 37"
src="https://user-images.githubusercontent.com/17645053/227456117-5eccedb7-9118-4540-929d-aee9a76de852.png">

In this PR, skip processing the link into a ref issue if it is a link
from files changed tab in pull request

After:
type in following
```
hash comment on files changed tab:
http://localhost:3000/testOrg/testOrgRepo/pulls/2/files#issuecomment-24

files changed link:
http://localhost:3000/testOrg/testOrgRepo/pulls/2/files
```
Gives

<img width="708" alt="截屏2023-03-27 22 09 02"
src="https://user-images.githubusercontent.com/17645053/227964273-5dc06c50-3713-489c-b05d-d95367d0ab0f.png">

2 Right now, after editing the comment area, there will not be tippys
attached to `ref-issue`; and no tippy attached on preview as well.
example:

https://user-images.githubusercontent.com/17645053/227850540-5ae34e2d-b1d7-4d0d-9726-7701bf825d1f.mov

In this PR, in frontend, make sure tippy is added after editing the
comment, and to the comment on preview tab
After:

https://user-images.githubusercontent.com/17645053/227853777-06f56b4c-1148-467c-b6f7-f79418e67504.mov
2023-04-03 16:02:57 +08:00
..
actions Fix checks for needs in Actions (#23789) 2023-03-30 22:33:17 +08:00
activitypub Add Chef package registry (#22554) 2023-02-06 09:49:21 +08:00
analyze Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
auth Fix various bugs for "install" page (#23194) 2023-03-04 10:12:02 +08:00
avatar Use minio/sha256-simd for accelerated SHA256 (#23052) 2023-02-22 14:21:46 -05:00
base Use minio/sha256-simd for accelerated SHA256 (#23052) 2023-02-22 14:21:46 -05:00
cache Improve cache context (#23330) 2023-03-08 11:57:05 -06:00
charset Use data-tooltip-content for tippy tooltip (#23649) 2023-03-24 18:35:38 +08:00
container Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
context Append (comment) when a link points at a comment rather than the whole issue (#23734) 2023-04-03 16:02:57 +08:00
csv Add context when rendering labels or emojis (#23281) 2023-03-05 22:59:05 +01:00
doctor Check LFS/Packages settings in dump and doctor command (#23631) 2023-03-23 20:30:28 +08:00
emoji Fix unstable emoji sort (#22346) 2023-01-05 13:58:51 +02:00
eventsource Move convert package to services (#22264) 2022-12-29 10:57:15 +08:00
generate Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
git Add git dashes separator to some "log" and "diff" commands (#23606) 2023-03-26 19:31:21 +01:00
gitgraph Add context cache as a request level cache (#22294) 2023-02-15 21:37:34 +08:00
graceful Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
hcaptcha Consume hcaptcha and pwn deps (#22610) 2023-01-29 09:49:51 -06:00
highlight test_env: hardcode major go version in use (#23464) 2023-03-14 16:09:01 -04:00
hostmatcher Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
html Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
httpcache Set X-Gitea-Debug header once (#23361) 2023-03-08 15:40:04 -05:00
httplib Refactor internal API for git commands, use meaningful messages instead of "Internal Server Error" (#23687) 2023-03-29 14:32:26 +08:00
indexer Add meilisearch support (#23136) 2023-03-28 22:23:23 -04:00
issue/template Allow issue templates to not render title (#22589) 2023-01-26 22:45:49 -06:00
json Update gitea-vet to check FSFE REUSE (#22004) 2022-12-02 22:14:57 +08:00
label Reduce duplicate and useless code in options (#23369) 2023-03-08 17:31:27 +08:00
lfs Make minio package support legacy MD5 checksum (#23768) 2023-03-28 11:10:24 -04:00
log Improve trace logging for pulls and processes (#22633) 2023-02-03 18:11:48 -05:00
markup Append (comment) when a link points at a comment rather than the whole issue (#23734) 2023-04-03 16:02:57 +08:00
mcaptcha Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
metrics include build info in Prometheus metrics (#22819) 2023-02-08 19:54:01 +02:00
migration Scoped labels (#22585) 2023-02-18 21:17:39 +02:00
mirror Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
nosql Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
notification Implement actions (#21937) 2023-01-31 09:45:19 +08:00
options Introduce path Clean/Join helper functions (#23495) 2023-03-21 16:02:49 -04:00
packages Display image size for multiarch container images (#23821) 2023-04-02 17:53:37 +08:00
paginator Update gitea-vet to check FSFE REUSE (#22004) 2022-12-02 22:14:57 +08:00
pprof Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
private Refactor internal API for git commands, use meaningful messages instead of "Internal Server Error" (#23687) 2023-03-29 14:32:26 +08:00
process Improve trace logging for pulls and processes (#22633) 2023-02-03 18:11:48 -05:00
proxy Use proxy for pull mirror (#22771) 2023-02-11 08:39:50 +08:00
proxyprotocol Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
public Fix incorrect CORS failure detection logic (#23844) 2023-03-31 11:35:48 -04:00
queue Properly flush unique queues on startup (#23154) 2023-02-28 17:55:43 -05:00
recaptcha Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
references Use correct captured group range when parsing cross-reference (#22672) 2023-01-31 10:08:05 +01:00
regexplru Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
repository Fix pull request update showing too many commits with multiple branches (#22856) 2023-03-09 12:14:22 -06:00
secret Use minio/sha256-simd for accelerated SHA256 (#23052) 2023-02-22 14:21:46 -05:00
session Update gitea-vet to check FSFE REUSE (#22004) 2022-12-02 22:14:57 +08:00
setting Add ONLY_SHOW_RELEVANT_REPOS back, fix explore page bug, make code more strict (#23766) 2023-03-29 08:41:45 -05:00
sitemap Fix sitemap (#22272) 2022-12-30 23:31:00 +08:00
ssh Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
storage Make minio package support legacy MD5 checksum (#23768) 2023-03-28 11:10:24 -04:00
structs Implement Issue Config (#20956) 2023-03-28 14:22:07 -04:00
svg Keep (add if not existing) xmlns attribute for generated SVG images (#23410) 2023-03-21 13:39:27 +08:00
sync Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
system Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
templates Improve template error reporting (#23396) 2023-03-20 15:56:48 -05:00
test Rename repo.GetOwner to repo.LoadOwner (#22967) 2023-02-18 20:11:03 +08:00
timeutil Use data-tooltip-content for tippy tooltip (#23649) 2023-03-24 18:35:38 +08:00
translation Append (comment) when a link points at a comment rather than the whole issue (#23734) 2023-04-03 16:02:57 +08:00
turnstile Add new captcha: cloudflare turnstile (#22369) 2023-02-05 15:29:03 +08:00
typesniffer Do not recognize text files as audio (#23355) 2023-03-07 22:40:41 -05:00
updatechecker Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
upload Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
uri Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
user Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
util Introduce path Clean/Join helper functions (#23495) 2023-03-21 16:02:49 -04:00
validation Map OIDC groups to Orgs/Teams (#21441) 2023-02-08 14:44:42 +08:00
watcher Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
web Map OIDC groups to Orgs/Teams (#21441) 2023-02-08 14:44:42 +08:00
webhook Restructure webhook module (#22256) 2023-01-01 23:23:15 +08:00