eclipse-jdt / eclipse-jdt/eclipse.jdt.core

[Markdown] "}" inside {@snippet} content prematurely terminates child fragments

Open
#5,075 0 comments 0 reactions 1 assignee Claimed by @subyssurendran666 View on GitHub
javadoc
Dominant language
Java
Stars
236
Forks
196
Avg merge
1d 10h
Merged PRs (30d)
49

Description

Image

```
/// Example showing formatter bug with {@code @} in snippet blocks.
/// {@snippet :
/// public class Example {
/// private String field;
/// }
/// void foo();
/// }

```
When parsing Markdown Javadoc comments containing a {@snippet} tag, encountering a } character inside the snippet content prematurely terminates subsequent child fragments in the generated AST. As a result, all remaining TextElements after the } inside the snippet content are omitted, including valid trailing snippet content such as class closing braces and method declarations.

I suspect this behaviour is related to the [markdown support for the snippet tag](https://github.com/eclipse-jdt/eclipse.jdt.core/pull/5003).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.