Skip to content

Commit

Permalink
fix newlines in generated markdown
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredlll08 committed Apr 27, 2021
1 parent 6680115 commit 54454e9
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 6 deletions.
Expand Up @@ -27,6 +27,10 @@ public String getDescription() {
return getOptionalDescription().orElse("No Description Provided");
}

public String getMarkdownDescription(){
return getDescription().replaceAll("\n", " <br /> ");
}

public boolean hasDescription() {
return getOptionalDescription().isPresent();
}
Expand Down
Expand Up @@ -37,7 +37,7 @@ public static PropertyMember merge(PropertyMember left, PropertyMember right) {
}

public void writeTableRow(PrintWriter writer) {
writer.printf("| %s | %s | %s | %s | %s |%n", name, type.getClickableMarkdown(), hasGetter, hasSetter, comment.getDescription());
writer.printf("| %s | %s | %s | %s | %s |%n", name, type.getClickableMarkdown(), hasGetter, hasSetter, comment.getMarkdownDescription());
}

public String getName() {
Expand Down
Expand Up @@ -55,7 +55,7 @@ public int numberOfExamples() {
}

public String getDescription() {
return comment.getDescription();
return comment.getMarkdownDescription();
}

public String getExample(int exampleIndex) {
Expand Down
Expand Up @@ -27,7 +27,7 @@ public int numberOfExamples() {
}

public String getDescription() {
return comment.getDescription();
return comment.getMarkdownDescription();
}

public boolean isOptional() {
Expand Down
Expand Up @@ -91,7 +91,7 @@ private boolean returnTypeInfoPresent() {

private void writeDescription(PrintWriter writer) {
if(methodComment.hasDescription()) {
writer.println(methodComment.getDescription());
writer.println(methodComment.getMarkdownDescription());
writer.println();
}
}
Expand Down
Expand Up @@ -31,7 +31,7 @@ private void writeParameterDescriptionTable(PrintWriter writer) {

private void writeDescription(PrintWriter writer) {
final DocumentationComment comment = getComment();
writer.println(comment.getDescription());
writer.println(comment.getMarkdownDescription());
}

private AbstractTypeInfo getConstructedType() {
Expand Down
Expand Up @@ -42,7 +42,7 @@ private void writeTitle(PrintWriter writer) {

private void writeDescription(PrintWriter writer) {
if(getComment().hasDescription()) {
writer.println(getComment().getDescription());
writer.println(getComment().getMarkdownDescription());
writer.println();
}
}
Expand Down

0 comments on commit 54454e9

Please sign in to comment.