Thank you both!
In my case, I find that hacking links in #outline is more practical.
#show outline: body => {
show link: it => if type(it.dest) == str {
// Remove external links
it.body
} else {
it
}
body
}
#outline()
= #link("https://example.com")[Link in Heading] <heading>
<nav role="doc-toc">
<h2>Contents</h2>
<ol style="list-style-type: none">
<li><a href="#heading">Heading in Link</a></li>
</ol>
</nav>
<h2 id="heading"><a href="https://example.com">Link in Heading</a></h2>
Then do you think an issue needs to be created?