apache / apache/maven-plugin-tools

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

Open
#823 1 comment 0 reactions 0 assignees View on GitHub
bug priority:major
Dominant language
Java
Stars
64
Forks
71
Avg merge
12h 24m
Merged PRs (30d)
32

Description

**[Alexander Kriegisch](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=kriegaex)** opened **[MPLUGIN-513](https://issues.apache.org/jira/browse/MPLUGIN-513?redirect=false)** and commented

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

```java
*

{@code

*
*
* dummy
* dummy
* ${project.basedir}/lib/agent.jar
*
*
* }

```

This "\

" 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:**
- [image-2024-03-18-17-00-11-575.png](https://issues.apache.org/jira/secure/attachment/13067501/image-2024-03-18-17-00-11-575.png) (_6.13 kB_)
- [image-2024-03-18-17-17-37-673.png](https://issues.apache.org/jira/secure/attachment/13067504/image-2024-03-18-17-17-37-673.png) (_22.18 kB_)
- [image-2024-03-18-17-20-31-473.png](https://issues.apache.org/jira/secure/attachment/13067505/image-2024-03-18-17-20-31-473.png) (_27.80 kB_)
- [screenshot-1.png](https://issues.apache.org/jira/secure/attachment/13067503/screenshot-1.png) (_7.04 kB_)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.