# 在目录中使用引用会重新加载页面但不会跳转到引用

**URL:** https://meta.discourse.org/t/using-a-reference-in-a-toc-reloads-the-page-without-moving-to-reference/358380
**Category:** Bug
**Tags:** disco-toc
**Created:** [2025年三月21日 19:33 UTC](https://meta.discourse.org/t/using-a-reference-in-a-toc-reloads-the-page-without-moving-to-reference/358380 "2025-03-21T19:33:29Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![RBoy](https://avatars.discourse-cdn.com/v4/letter/r/2bfe46/32.png) [@RBoy](https://meta.discourse.org/u/RBoy)
#### Post date: [2025年三月21日 19:33 UTC](https://meta.discourse.org/t/using-a-reference-in-a-toc-reloads-the-page-without-moving-to-reference/358380/1 "2025-03-21T19:33:29Z")

</div>

正在尝试使用目录（TOC）链接到常见问题解答中的主题。当我点击目录项时，它会重新加载页面，并且不会在 URL 中传递“#”引用，因此页面无法跳转。但是，如果我直接在浏览器中输入 URL，则可以正常工作。

这是代码：

```html
<details open><summary>Table Of Contents: </summary><ul>
<li><a href="https://meta.discourse.org/t/358380#some-heading-topic-1">
This link should take me to Topic 1</a></li><br>
<li><a href="https://meta.discourse.org/t/358380#some-heading-topic-2">
This link should take me to Topic 2</a></li><br>
<li><a href="https://meta.discourse.org/t/358380#some-heading-topic-3">
This link should take me to Topic 3</a></li><br>
<li><a href="https://meta.discourse.org/t/358380#some-heading-topic-4">
This link should take me to Topic 4</a></li><br>
<li><a href="https://meta.discourse.org/t/358380#some-heading-topic-5">
This link should take me to Topic 5</a></li><br>
<li><a href="https://meta.discourse.org/t/358380#some-heading-topic-6">
This link should take me to Topic 6</a></li><br>
<li><a href="https://meta.discourse.org/t/358380#some-heading-topic-7">
This link should take me to Topic 7</a></li><br>
<li><a href="https://meta.discourse.org/t/358380#some-heading-topic-8">
This link should take me to Topic 8</a></li><br>

<div data-theme-toc="false"></div>

## Some heading topic 1

**Text A**

> Description of issue and resolution

---

## Some heading topic 2

**Text A**

> Description of issue and resolution

---

## Some heading topic 3

**Text A**

> Description of issue and resolution

---

## Some heading topic 4

**Text A**

> Description of issue and resolution

---

## Some heading topic 5

**Text A**

> Description of issue and resolution

---

## Some heading topic 6

**Text A**

> Description of issue and resolution

---

## Some heading topic 7

**Text A**

> Description of issue and resolution

---

## Some heading topic 8

**Text A**

> Description of issue and resolution

---

```

> **Table Of Contents:**
>
> - [This link should take me to Topic 1](https://meta.discourse.org/t/358380#some-heading-topic-1)
>   
> - [This link should take me to Topic 2](https://meta.discourse.org/t/358380#some-heading-topic-2)
>   
> - [This link should take me to Topic 3](https://meta.discourse.org/t/358380#some-heading-topic-3)
>   
> - [This link should take me to Topic 4](https://meta.discourse.org/t/358380#some-heading-topic-4)
>   
> - [This link should take me to Topic 5](https://meta.discourse.org/t/358380#some-heading-topic-5)
>   
> - [This link should take me to Topic 6](https://meta.discourse.org/t/358380#some-heading-topic-6)
>   
> - [This link should take me to Topic 7](https://meta.discourse.org/t/358380#some-heading-topic-7)
>   
> - [This link should take me to Topic 8](https://meta.discourse.org/t/358380#some-heading-topic-8)
>   
> 
> ## Some heading topic 1
> 
> **Text A**
> 
> > Description of issue and resolution
> 
> * * *
> 
> ## Some heading topic 2
> 
> **Text A**
> 
> > Description of issue and resolution
> 
> * * *
> 
> ## Some heading topic 3
> 
> **Text A**
> 
> > Description of issue and resolution
> 
> * * *
> 
> ## Some heading topic 4
> 
> **Text A**
> 
> > Description of issue and resolution
> 
> * * *
> 
> ## Some heading topic 5
> 
> **Text A**
> 
> > Description of issue and resolution
> 
> * * *
> 
> ## Some heading topic 6
> 
> **Text A**
> 
> > Description of issue and resolution
> 
> * * *
> 
> ## Some heading topic 7
> 
> **Text A**
> 
> > Description of issue and resolution
> 
> * * *
> 
> ## Some heading topic 8
> 
> **Text A**
> 
> > Description of issue and resolution
> 
> * * *
>   
>   
> 
> 在此示例中，如果点击“Topic 3”的链接，目录会加载页面，但我直接在浏览器中输入 URL `https://meta.discourse.org/t/358380#p-1737996-some-heading-topic-3-3` 可以跳转到主题标题。

---

<div class="post-metadata">

### Author: ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)
#### Post date: [2025年三月21日 19:54 UTC](https://meta.discourse.org/t/using-a-reference-in-a-toc-reloads-the-page-without-moving-to-reference/358380/2 "2025-03-21T19:54:18Z")

</div>

你好 RBoy 🙂

这个问题在这里被提到了：

> [@Arthri](#):
>
> 除第一个链接外，所有链接都会重新加载页面。

---

<div class="post-metadata">

### Author: ![RBoy](https://avatars.discourse-cdn.com/v4/letter/r/2bfe46/32.png) [@RBoy](https://meta.discourse.org/u/RBoy)
#### Post date: [2025年三月22日 15:38 UTC](https://meta.discourse.org/t/using-a-reference-in-a-toc-reloads-the-page-without-moving-to-reference/358380/3 "2025-03-22T15:38:37Z")

</div>

有趣的是，这在去年中后期曾经可以运行。后来在某个时候变坏了。
