diff --git a/maven-plugin-tools-generators/src/main/java/org/apache/maven/tools/plugin/generator/HtmlToPlainTextConverter.java b/maven-plugin-tools-generators/src/main/java/org/apache/maven/tools/plugin/generator/HtmlToPlainTextConverter.java index 6906c75cf..fd52e0249 100644 --- a/maven-plugin-tools-generators/src/main/java/org/apache/maven/tools/plugin/generator/HtmlToPlainTextConverter.java +++ b/maven-plugin-tools-generators/src/main/java/org/apache/maven/tools/plugin/generator/HtmlToPlainTextConverter.java @@ -59,7 +59,12 @@ private String getPlainText(Element element) { // the formatting rules, implemented in a breadth-first DOM traverse private static class FormattingVisitor implements NodeVisitor { + // Placeholder for indentation spaces that must survive the whitespace cleanup in toString(), which + // otherwise collates any run of real spaces -- including nested
  • indentation -- down to one. + private static final char INDENT_MARKER = '\u0001'; + private StringBuilder accum = new StringBuilder(); // holds the accumulated text + private int listDepth = 0; // nesting depth of the current