Skip to content

Conversation

@lewisbirks
Copy link
Contributor

I noticed that the subsection MVC API - Execution Model was being used as the anchor link in the content for the Execution Model heading.

I think this is due to the tocItems method updating all links in the documents when the id changes rather than just those within it's element

if (!id.equals(newId)) {
h.attr("id", newId);
doc.select("a")
.forEach(
a -> {
if (a.attr("href").equals("#" + id) && a.attr("class").length() > 0) {
a.attr("href", "#" + newId);
}
});
}

I have updated this method to use h rather than doc and from what I can tell from a manual pass through, all links seem to work.

I've also moved the post processing functionality to make use of the inbuilt AsciiDoctorJ post processing extension, this should make the generation process slightly more efficient as it cuts down on the amount of file reads/writes being performed. As this is a separate change that is only tangentially related by being in the same area I can move it to it's own PR if wanted.

Copy link
Member

@jknack jknack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! Any enhancement here is always welcome.

@jknack jknack added this to the 3.10.0 milestone Jul 1, 2025
@jknack jknack merged commit 65fe78b into jooby-project:3.x Jul 1, 2025
1 check passed
@lewisbirks lewisbirks deleted the fix-xref-links branch July 2, 2025 09:04
@jknack
Copy link
Member

jknack commented Jul 2, 2025

All your changes are live, thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants