Skip to content

GH-822: Preserve relative links in generated descriptions - #1215

Open
efegokdemir wants to merge 1 commit into
apache:masterfrom
efegokdemir:codex/issue-822-relative-links
Open

efegokdemir wants to merge 1 commit into
apache:masterfrom
efegokdemir:codex/issue-822-relative-links

Conversation

@efegokdemir

@efegokdemir efegokdemir commented Sep 24, 2026 •

Copy link
Copy Markdown

Rationale for this change

HtmlToPlainTextConverter only used Jsoup's absolute URL resolution, so relative page links in generated help descriptions were rendered without their target. Preserve relative href values while continuing to omit fragment-only anchors.

What changes are included in this PR?

  • Fall back to the original href when Jsoup cannot resolve an absolute URL.
  • Keep fragment-only links out of the plain-text URL suffix.
  • Add regression coverage for relative page links.

Are these changes tested?

  • mvn -pl maven-plugin-tools-generators -Dspotless.check.skip=true -Dspotless.apply.skip=true test — passed (18 tests, 1 skipped).
  • mvn -pl maven-plugin-tools-generators -Dspotless.check.skip=true -Dspotless.apply.skip=true verify — passed.
  • git diff --check — passed.
  • Spotless could not run locally on JDK 27 because its formatter fails with NoSuchFieldError in com.sun.tools.javac.tree.JCTree; the repository checks and tests pass with only the formatter checks skipped.

Are there any user-facing changes?

Relative links in generated plugin help text now include their targets, matching absolute links.

Closes #822

AI assistance was used in preparing this contribution; the submitting contributor reviewed the changed lines, tests, and final diff.

  • I hereby declare that this code conforms to the Apache Software Foundation's Code of Conduct
  • I have read and understand the contribution guidelines
  • I have tested the changes in this PR
  • I have opened an issue for this PR and linked it in the description

Signed-off-by: Efe Gökdemir <efe@rexcode.co.uk>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[MPLUGIN-518] Relative links not working in descriptions

1 participant