canonical / canonicalwebteam.discourse

GNU Lesser General Public License v3.0
11 stars 16 forks source link

Header links placed within folded content do not work with some browsers #170

Open pmatulis opened 1 year ago

pmatulis commented 1 year ago

With some browsers, at least Firefox, links that reside within folded content do not work. It's as if they do not exist. The user is therefore punted to the top of the page. Can something be done about this?

For instance, link https://ubuntu.com/blah/docs/page#heading--test does not work where the following is in use:

[details=Expand]
<a href="#heading--test"><h2 id="heading--test">test</h2></a>
[/details]

Attempting to work around this by placing an anchor also failed:

<a id="#heading--workaround"> </a>

[details=Expand]
<a href="#heading--test"><h2 id="heading--test">test</h2></a>
[/details]

As the source becomes:

<p><a> </a></p>
<details>
<summary>
Expand</summary>
<p><a href="#heading--test"></a></p>
<h2 id="heading--test"><a href="#heading--test">test</a></h2>
<p></p>
</details>