Skip to content

Commit

Permalink
Merge pull request #378 from uhafner/markdown-newlines
Browse files Browse the repository at this point in the history
Fix new lines in summary
  • Loading branch information
uhafner authored Sep 26, 2024
2 parents 1d9db3d + bb0541c commit 3b57f1f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/main/java/edu/hm/hafner/grading/GradingReport.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,14 @@ public String getMarkdownSummary(final AggregatedScore score) {
* @return Markdown text
*/
public String getMarkdownSummary(final AggregatedScore score, final String title) {
return createMarkdownTotal(score, title, 3) + getSubScoreDetails(score) + HORIZONTAL_RULE;
return createMarkdownTotal(score, title, 3) + PARAGRAPH + getSubScoreDetails(score) + HORIZONTAL_RULE;
}

private String createPercentage(final AggregatedScore score) {
if (score.getMaxScore() == 0) {
return StringUtils.EMPTY;
}
return ScoreMarkdown.getPercentageImage("Score percentage", score.getAchievedPercentage());
return ScoreMarkdown.getPercentageImage("Score percentage", score.getAchievedPercentage()) + PARAGRAPH;
}

/**
Expand All @@ -90,7 +90,7 @@ private String createPercentage(final AggregatedScore score) {
public StringBuilder getSubScoreDetails(final AggregatedScore score) {
var summary = new StringBuilder();

summary.append(createPercentage(score)).append(PARAGRAPH);
summary.append(createPercentage(score));

if (score.hasTests()) {
summary.append(TEST_MARKDOWN.createSummary(score));
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/edu/hm/hafner/grading/ScoreMarkdown.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
abstract class ScoreMarkdown<S extends Score<S, C>, C extends Configuration> {
protected static final int ICON_SIZE = 18;
static final String SPACE = "&nbsp;";
static final String LINE_BREAK = "\n";
static final String LINE_BREAK = "\\\n";
static final String LEDGER = ":heavy_minus_sign:";
static final String IMPACT = ":moneybag:";
static final String TOTAL = ":heavy_minus_sign:";
Expand Down

0 comments on commit 3b57f1f

Please sign in to comment.