J’essaie d’utiliser une table des matières (TOC) pour créer des liens vers des sujets dans une FAQ. Lorsque je clique sur un élément de la TOC, la page se recharge et la référence # n’est pas transmise dans l’URL, donc la page ne mène nulle part. Cependant, si j’entre l’URL directement dans le navigateur, cela fonctionne.
Voici le code :
<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
- This link should take me to Topic 2
- This link should take me to Topic 3
- This link should take me to Topic 4
- This link should take me to Topic 5
- This link should take me to Topic 6
- This link should take me to Topic 7
- This link should take me to 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
Dans cet exemple, si je clique sur le lien pour le Topic 3, la TOC charge la page, mais si j’entre l’URL https://meta.discourse.org/t/358380#p-1737996-some-heading-topic-3-3 directement dans le navigateur, cela m’amène à l’en-tête du sujet.