XYZ 페이지에 있을 때 /t/XYZ#anchor가 작동하지 않음

Hello! There’s a problem where if a post links to itself using short link + an anchor (/t/id#anchor) and the link is clicked on the same page, it will redirect to the top rather than the anchor

It’s easier when demonstrated:

Header 1

  1. #header-1 works when tabbed on this thread
  2. https://meta.discourse.org/t/t-xyz-anchor-doesnt-work-when-on-the-page-xyz/225101#header-1-1 works when tabbed on this thread and quoted
  3. https://meta.discourse.org/t/a/225101#header-1-1 works when tabbed on this thread and quoted
  4. https://meta.discourse.org/t/225101#header-1-1 works when not tabbed on this thread
  5. /t/t-xyz-anchor-doesnt-work-when-on-the-page-xyz/225101#header-1-1 works when tabbed on this thread and quoted
  6. /t/a/225101#header-1-1 works when tabbed on this thread and quoted
  7. /t/225101#header-1-1 works when not tabbed on this thread

There’s also two other problems I noticed. All links except the first will reload the page. Links 2, 3, 5 and 6 work but the header is removed from the url after a short amount of time


My original problem was quoting a post which contained a link with only anchor(a link to another section of the same page) would make the anchor relative to the current page rather than the quoted page. If you quote the seven links, the first link will lead to CURRENT PAGE#header-1

I tried the solution in this bug report(attached below). It correctly linked to the page, however, the anchor was not respected

1개의 좋아요

저도 #앵커 변형에서 이 문제가 발생합니다. 항상 페이지가 다시 로드되는 것은 아닙니다. 아마도 주제가 처음 로드될 때 그런 앵커를 처음 클릭할 때만 발생하는 것 같습니다. 불행히도 정확한 재현 단계를 알려드릴 수는 없습니다.

그리고 여기서 말하는 "리로드"는 브라우저 탭의 새로 고침을 의미하지 않습니다. "웹 앱"이 다시 로드되는 것을 의미하며, 뷰포트 상단에 진행 표시줄이 나타납니다.