Skip to content

Fix #807: helpmojo flattens nested lists in javadoc - #1259

Open
arturobernalg wants to merge 1 commit into
apache:masterfrom
arturobernalg:fix/807-nested-list-helpmojo
Open

arturobernalg wants to merge 1 commit into
apache:masterfrom
arturobernalg:fix/807-nested-list-helpmojo

Conversation

@arturobernalg

Copy link
Copy Markdown
Member

Fixes #807.

HtmlToPlainTextConverter.FormattingVisitor appended "\n * " for every

  • regardless of nesting depth, and its cleanup step collated any run of spaces -- including indentation meant to show nesting -- down to one. A nested
      /
    • structure in a Mojo's or parameter's javadoc always rendered as one flat bullet level in the plain-text output used by mvn :help, losing the nesting the javadoc author intended.

      FormattingVisitor now tracks

        /
          nesting depth and indents each
        1. accordingly, using a placeholder character for the indentation spaces so the existing space-collation cleanup doesn't erase it -- the placeholder is only expanded to real spaces as the last step of toString(). Added tests for a single-level list (unchanged output), a nested list, and a doubly-nested list. Full module suite, checkstyle and spotless pass locally.

          To make clear that you license your contribution under the Apache License Version 2.0, January 2004, check one of the following:

          • I hereby declare this contribution to be licensed under the Apache License Version 2.0, January 2004
          • I hereby declare that I have filed an Apache Individual Contributor License Agreement.
  • HtmlToPlainTextConverter.FormattingVisitor appended "\n * " for every
    <li> regardless of nesting depth, and its cleanup step collated any
    run of spaces -- including indentation meant to show nesting -- down
    to one. A nested <ul>/<li> structure in a Mojo's or parameter's
    javadoc always rendered as one flat bullet level in the plain-text
    output used by mvn <plugin>:help, losing the nesting the javadoc
    author intended.
    
    FormattingVisitor now tracks <ul>/<ol> nesting depth and indents each
    <li> accordingly, using a placeholder character for the indentation
    spaces so the existing space-collation cleanup doesn't erase it --
    the placeholder is only expanded to real spaces as the last step of
    toString(). Added tests for a single-level list (unchanged output), a
    nested list, and a doubly-nested list.
    @slachiewicz slachiewicz added the bug Something isn't working label Oct 29, 2026
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Labels

    bug Something isn't working

    Projects

    None yet

    Development

    Successfully merging this pull request may close these issues.

    [MPLUGIN-505] helpmojo: does not respect nested list in javadoc

    2 participants