You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
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
1 year ago
..
actions Fix checks for `needs` in Actions (#23789) 1 year ago
activitypub Add Chef package registry (#22554) 1 year ago
analyze Implement FSFE REUSE for golang files (#21840) 2 years ago
auth Fix various bugs for "install" page (#23194) 1 year ago
avatar Use minio/sha256-simd for accelerated SHA256 (#23052) 1 year ago
base Use minio/sha256-simd for accelerated SHA256 (#23052) 1 year ago
cache Improve cache context (#23330) 1 year ago
charset Use data-tooltip-content for tippy tooltip (#23649) 1 year ago
container Implement FSFE REUSE for golang files (#21840) 2 years ago
context Append `(comment)` when a link points at a comment rather than the whole issue (#23734) 1 year ago
csv Add context when rendering labels or emojis (#23281) 1 year ago
doctor Check LFS/Packages settings in dump and doctor command (#23631) 1 year ago
emoji Fix unstable emoji sort (#22346) 2 years ago
eventsource Move `convert` package to services (#22264) 2 years ago
generate Implement FSFE REUSE for golang files (#21840) 2 years ago
git Add git dashes separator to some "log" and "diff" commands (#23606) 1 year ago
gitgraph Add context cache as a request level cache (#22294) 1 year ago
graceful Implement FSFE REUSE for golang files (#21840) 2 years ago
hcaptcha Consume hcaptcha and pwn deps (#22610) 1 year ago
highlight test_env: hardcode major go version in use (#23464) 1 year ago
hostmatcher Implement FSFE REUSE for golang files (#21840) 2 years ago
html Implement FSFE REUSE for golang files (#21840) 2 years ago
httpcache Set `X-Gitea-Debug` header once (#23361) 1 year ago
httplib Refactor internal API for git commands, use meaningful messages instead of "Internal Server Error" (#23687) 1 year ago
indexer Add meilisearch support (#23136) 1 year ago
issue/template Allow issue templates to not render title (#22589) 1 year ago
json Update gitea-vet to check FSFE REUSE (#22004) 2 years ago
label Reduce duplicate and useless code in options (#23369) 1 year ago
lfs Make minio package support legacy MD5 checksum (#23768) 1 year ago
log Improve trace logging for pulls and processes (#22633) 1 year ago
markup Append `(comment)` when a link points at a comment rather than the whole issue (#23734) 1 year ago
mcaptcha Implement FSFE REUSE for golang files (#21840) 2 years ago
metrics include build info in Prometheus metrics (#22819) 1 year ago
migration Scoped labels (#22585) 1 year ago
mirror Implement FSFE REUSE for golang files (#21840) 2 years ago
nosql Implement FSFE REUSE for golang files (#21840) 2 years ago
notification Implement actions (#21937) 1 year ago
options Introduce path Clean/Join helper functions (#23495) 1 year ago
packages Display image size for multiarch container images (#23821) 1 year ago
paginator Update gitea-vet to check FSFE REUSE (#22004) 2 years ago
pprof Implement FSFE REUSE for golang files (#21840) 2 years ago
private Refactor internal API for git commands, use meaningful messages instead of "Internal Server Error" (#23687) 1 year ago
process Improve trace logging for pulls and processes (#22633) 1 year ago
proxy Use proxy for pull mirror (#22771) 1 year ago
proxyprotocol Implement FSFE REUSE for golang files (#21840) 2 years ago
public Fix incorrect CORS failure detection logic (#23844) 1 year ago
queue Properly flush unique queues on startup (#23154) 1 year ago
recaptcha Implement FSFE REUSE for golang files (#21840) 2 years ago
references Use correct captured group range when parsing cross-reference (#22672) 1 year ago
regexplru Implement FSFE REUSE for golang files (#21840) 2 years ago
repository Fix pull request update showing too many commits with multiple branches (#22856) 1 year ago
secret Use minio/sha256-simd for accelerated SHA256 (#23052) 1 year ago
session Update gitea-vet to check FSFE REUSE (#22004) 2 years ago
setting Add ONLY_SHOW_RELEVANT_REPOS back, fix explore page bug, make code more strict (#23766) 1 year ago
sitemap Fix sitemap (#22272) 2 years ago
ssh Implement FSFE REUSE for golang files (#21840) 2 years ago
storage Make minio package support legacy MD5 checksum (#23768) 1 year ago
structs Implement Issue Config (#20956) 1 year ago
svg Keep (add if not existing) xmlns attribute for generated SVG images (#23410) 1 year ago
sync Implement FSFE REUSE for golang files (#21840) 2 years ago
system Implement FSFE REUSE for golang files (#21840) 2 years ago
templates Improve template error reporting (#23396) 1 year ago
test Rename `repo.GetOwner` to `repo.LoadOwner` (#22967) 1 year ago
timeutil Use data-tooltip-content for tippy tooltip (#23649) 1 year ago
translation Append `(comment)` when a link points at a comment rather than the whole issue (#23734) 1 year ago
turnstile Add new captcha: cloudflare turnstile (#22369) 1 year ago
typesniffer Do not recognize text files as audio (#23355) 1 year ago
updatechecker Implement FSFE REUSE for golang files (#21840) 2 years ago
upload Implement FSFE REUSE for golang files (#21840) 2 years ago
uri Implement FSFE REUSE for golang files (#21840) 2 years ago
user Implement FSFE REUSE for golang files (#21840) 2 years ago
util Introduce path Clean/Join helper functions (#23495) 1 year ago
validation Map OIDC groups to Orgs/Teams (#21441) 1 year ago
watcher Implement FSFE REUSE for golang files (#21840) 2 years ago
web Map OIDC groups to Orgs/Teams (#21441) 1 year ago
webhook Restructure `webhook` module (#22256) 2 years ago