Skip to content

[MPLUGIN-513] Closing curly brace in code block rendered incorrectly #823

Open

Description

@jira-importer

Alexander Kriegisch opened MPLUGIN-513 and commented

In my plugin parameter javadoc, I use something like this:

* <pre>{@code
* <javaAgents>
*   <agent>
*     <groupId>dummy</groupId>
*     <artifactId>dummy</artifactId>
*     <agentPath>${project.basedir}/lib/agent.jar</agentClass>
*   </agent>
* </javaAgents>
* }</pre>

This "<pre>" and "{@code ...}" combination is used, if we want to avoid having to escape XML tags and preserve line breaks at the same time. This works fine when generating javadocs, ...

!screenshot-1.png!

but in a Maven plugin goal description, the result looks like this:

!image-2024-03-18-17-00-11-575.png!

I.e., some text after the nested closing curly brace is suppressed and some emty lines rendered instead. It looks correct on the Maven site, if instead of "${project.basedir}" I write "${project.basedir}", but then javadoc generation fails with an error, because HTML entities are not permitted in that block. I.e., that is not the way to go, because we must not break javadoc generation.

This ought to be fixed in Maven Site Plugin. It might be subtle and somewhat of an advanced edge case, but the rendered HTML for the plugin description should look correctly, just as it does for javadocs. The nested closing curly brace ought to be parsed correctly.


Affects: 3.11.0

Attachments:

Activity

  1. jira-importer commented on Mar 18, 2024

    @jira-importer
    Author

    Alexander Kriegisch commented

    More information: This is what gets rendered for the Maven site:

    !image-2024-03-18-17-17-37-673.png!

    Please note how the closing code tag is inserted where the inner closing curly brace is in the source text, i.e. the latter is interpreted falsely as the end of the "{@code ...}" block.

    In the javadocs, it looks like this instead:

    !image-2024-03-18-17-20-31-473.png!

    I.e., in the javadocs the nesting of HTML tags is correct.

  2. added
    bug
    priority:major
    on Jun 19, 2025
  3. removed
    priority:major
    on Sep 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions