JavaDoc "pre" tags are not formatting correctly #254
Answered
by
gastaldi
rob-stoecklein
asked this question in
Q&A
|
We are using Roaster to read source files, make a few changes, then save the results to new source files. Most of this is working quite well. One issue, however, is how "pre" tags are handled: all of the text inside of a "pre" tag ends up in a single line. For example, if the input file is: Processing it gives us: This is the source code that reads the Is there something we're doing wrong here? If not, is there a work-around or fix for this? Thanks. |
Answered by
gastaldi
Sep 13, 2022
Replies: 1 comment 1 reply
|
Seems to be an Eclipse JDT parsing issue. It can be easily reproducible by doing this: String data = """
/**
* <pre>
* All | of | this | should | be | aligned
* but | it | is | merged | into | a
* single | line |
* </pre>
*/
public interface TestInterface {
}
""";
ASTParser parser = ASTParser.newParser(AST.getJLSLatest());
parser.setKind(ASTParser.K_COMPILATION_UNIT);
parser.setSource(data.toCharArray());
ASTNode ast = parser.createAST(null);
System.out.println(ast);It outputs: /**
* <pre> All | of | this | should | be | aligned but | it | is | merged | into | a single | line | </pre>
*/
public interface TestInterface {
} |
1 reply
Answer selected by
rob-stoecklein
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Seems to be an Eclipse JDT parsing issue. It can be easily reproducible by doing this:
It outputs: