Closed cfa closed 1 year ago
Since those doc link targets may be updated soon, here's a reproduction that doesn't depend on the state of that repo.
Create file demo.pod6
containing
=begin pod
L<one|/a>, L<two|/a> and L<three|/b>.
=end pod
and generate HTML:
$ Rakudoc-to-html demo.pod6
demo.html has been generated in the local directory.
This currently creates a document with the following links:
Note that the second incorrectly reads "one" (instead of "two").
Here's the relevant HTML:
$ grep one demo.html
<img id="Camelia_bug" src="/asset_files/images/Camelia.svg"><h1 class="title">NO_TITLE</h1></header><div class="pod-content"><div id=""></div><div class="pod-body no-toc"><section name="___top"><p><a href="/a.html">one</a>, <a href="/a.html">one</a> and <a href="/b.html">three</a>.</p></section> </div>
namely <a href="/a.html">one</a>, <a href="/a.html">one</a> and <a href="/b.html">three</a>.
(@coke FYI)
@cfa I'm under a bit of pressure at the moment with other commitments. I'll respond here as soon as I find time.
On Fri, 10 Mar 2023, 02:07 cfa, @.***> wrote:
@.*** https://github.com/coke FYI)
— Reply to this email directly, view it on GitHub https://github.com/finanalyst/raku-pod-render/issues/16#issuecomment-1463107206, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACYZHBAQPXGHM26UWKB3JDW3KEHFANCNFSM6AAAAAAVVPTAME . You are receiving this because you are subscribed to this thread.Message ID: @.***>
No worries.
@cfa @coke The problem is that raku-pod-render
caches each link, together with the label. So when the link appears again, the cached label (first one) is used. Thinking about how to retain the cache but ensure that the proper label is used.
@cfa Thanks for golfing down the problem
So the question now is whether to cache each link-label pair. The link registry is used to verify whether expected links exist, which does not need unique label information. If the link does not exist, then all labels to that link (url) will not exist. But at least one label is needed to help in the debug process. So the first label will be cached with the link, but the label will be returned as received.
Links to the same target from a given source document seem to re-use the first link's text.
For example:
Zen slicing does not L<reify|/language/glossary#index-entry-Reify> or L<cache|/routine/cache>
(see here).L<reification|/language/glossary#index-entry-Reify>
.Returns a DateTime object for the same time, but in the local time zone (L«C<$*TZ>|/language/variables#index-entry-%24*TZ»).
(see here)and defaults to the value of L«C<$*TZ> variable|/language/variables#index-entry-%24*TZ».