-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Fix and rewrite markup anchor processing #29931
Conversation
|
Not sure this is right. It seems odd that we decode something that was previously encoded. I think removing all the decodes may just be enough too. I'd certainly want to add some unit tests in vitest for sure. |
I don't know whether it is right either .... does the author or approvers have more information to write into comment? |
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.
needs deeper investigation, i will do later.
As per https://stackoverflow.com/a/50141030/808699 and https://jsfiddle.net/silverwind/pe0twrf8/, it seems unnecssary to encode when setting a Not sure about the decode yet, but my intuition tells me it's unnecessary too. |
Fiddle updated: https://jsfiddle.net/silverwind/pe0twrf8/7/ My conclusion is
|
Apparently it does make a difference whether a link is generated or pre-existing in HTML: https://jsfiddle.net/silverwind/2wy39d7e/ So backend-generated links will appear escaped and need a I'll work out something on this branch. |
I rewrote this file quite a bit now, the code is now easier to read and there is no more complex Everything is working and I specifically tested with chinese links as well. @lunny can you try you test case on wiki as well? |
56d6421
to
cb2e65d
Compare
Fix go-gitea#29877 --------- Co-authored-by: silverwind <[email protected]>
Backport #29931 by @lunny Fix #29877 Co-authored-by: Lunny Xiao <[email protected]> Co-authored-by: silverwind <[email protected]>
Yes, but it comes out encoded from the backend, I assume from the markup renderer. So it would need to be fixed there first. If you can, raise a PR and then I will adapt the JS in the same PR to support this. |
* giteaofficial/main: (34 commits) Refactor URL detection (go-gitea#29960) Solving the issue of UI disruption when the review is deleted without refreshing (go-gitea#29951) Fix JS error and improve error message styles (go-gitea#29963) Fix the bug that user may logout if he switch pages too fast (go-gitea#29962) Cancel previous runs of the same PR automatically (go-gitea#29961) Exclude `routers/private/tests` from air (go-gitea#29949) Remove codecov badge (go-gitea#29950) Misc color tweaks (go-gitea#29943) Fix and rewrite markup anchor processing (go-gitea#29931) Remove fomantic grid module (go-gitea#29894) Add background to dashboard navbar, fix missing padding (go-gitea#29940) Prevent layout shift in `<overflow-menu>` items (go-gitea#29831) Fix loadOneBranch panic (go-gitea#29938) Fix comment review avatar alignment (go-gitea#29935) Remove the negative margin from `.page-content` (go-gitea#29922) Move notifications to a standalone file (go-gitea#29930) Remove unnecessary ".Link" usages (go-gitea#29929) Remove unnecessary ".Link" usages (go-gitea#29909) Show Actions post step when it's running (go-gitea#29926) Fix the wrong default value of ENABLE_OPENID_SIGNIN on docs (go-gitea#29925) ... # Conflicts: # templates/user/dashboard/issues.tmpl
* origin/main: (332 commits) Refactor external URL detection (go-gitea#29973) Refactor repo header/list (go-gitea#29969) Fix various loading states, remove `.loading` class (go-gitea#29920) Update register application URL for GitLab (go-gitea#29959) Refactor StringsToInt64s (go-gitea#29967) Switch to happy-dom for testing (go-gitea#29948) Performance improvements for pull request list page (go-gitea#29900) Refactor URL detection (go-gitea#29960) Solving the issue of UI disruption when the review is deleted without refreshing (go-gitea#29951) Fix JS error and improve error message styles (go-gitea#29963) Fix the bug that user may logout if he switch pages too fast (go-gitea#29962) Cancel previous runs of the same PR automatically (go-gitea#29961) Exclude `routers/private/tests` from air (go-gitea#29949) Remove codecov badge (go-gitea#29950) Misc color tweaks (go-gitea#29943) Fix and rewrite markup anchor processing (go-gitea#29931) Remove fomantic grid module (go-gitea#29894) Add background to dashboard navbar, fix missing padding (go-gitea#29940) Prevent layout shift in `<overflow-menu>` items (go-gitea#29831) Fix loadOneBranch panic (go-gitea#29938) ...
Fix #29877