Fix anchor links being overwritten #3709
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
tocItemsmethod updating all links in the documents when the id changes rather than just those within it's elementjooby/docs/src/main/java/io/jooby/adoc/DocGenerator.java
Lines 411 to 420 in 5e345b5
I have updated this method to use
hrather thandocand 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.