mirror of
https://github.com/google/nomulus.git
synced 2025-05-14 00:17:20 +02:00
De-duplicate flow documentation error reasons on a per-code basis
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=250894847
This commit is contained in:
parent
e489539df4
commit
79bcb227be
2 changed files with 11 additions and 11 deletions
|
@ -163,15 +163,18 @@ public final class MarkdownDocumentationFormatter {
|
|||
for (Long code : flowDoc.getErrorsByCode().keySet()) {
|
||||
output.append(String.format("* %d\n", code));
|
||||
|
||||
flowDoc.getErrorsByCode().get(code).stream()
|
||||
.map(ErrorCase::getReason)
|
||||
.distinct()
|
||||
.forEach(
|
||||
reason -> {
|
||||
output.append(" * ");
|
||||
String wrappedReason = reflow(fixHtml(reason), LINE_WIDTH - 8);
|
||||
|
||||
for (ErrorCase error : flowDoc.getErrorsByCode().get(code)) {
|
||||
output.append(" * ");
|
||||
String wrappedReason = reflow(fixHtml(error.getReason()), LINE_WIDTH - 8);
|
||||
|
||||
// Replace internal newlines with indentation and strip the final newline.
|
||||
output.append(wrappedReason.trim().replace("\n", "\n" + INDENT8));
|
||||
output.append('\n');
|
||||
}
|
||||
// Replace internal newlines with indentation and strip the final newline.
|
||||
output.append(wrappedReason.trim().replace("\n", "\n" + INDENT8));
|
||||
output.append('\n');
|
||||
});
|
||||
}
|
||||
output.append('\n');
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue