Skip to content

JavaDoc "pre" tags are not formatting correctly #254

Answered by gastaldi
rob-stoecklein asked this question in Q&A
Discussion options

You must be logged in to vote

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:

/** 
 *…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@rob-stoecklein
Comment options

Answer selected by rob-stoecklein
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants