Skip to content
Permalink
Browse files
[JENKINS-33105] Adding empty line to preserve blank/empty lines
  • Loading branch information
benjaminfuchs committed Jul 25, 2017
1 parent 983d757 commit 7aaec1cab079117597a89f7793893d6c24fd738f
@@ -59,12 +59,19 @@ public ConsoleAnnotator annotate(Object context, MarkupText text) {
calls++;
int end = text.length() - 1;

// Trick to make sure we wrap everything including the Timestamp from Timestamper plugin
text.addMarkup(0, 0, "",
MessageFormat.format("<p class=\"line\"><a class=\"linenumber\" id=\"L{0}\" href=\"#L{0}\"></a><span>", calls));
text.addMarkup(end, end, "", "</span></p>");
if (text.getText().matches("^\\s$")) {
// Trick to make sure we wrap everything including the Timestamp from Timestamper plugin
text.addMarkup(0, 0, "",
MessageFormat.format("<p class=\"empty\"><a class=\"linenumber\" id=\"L{0}\" href=\"#L{0}\"></a><span>", calls));
text.addMarkup(end, end, "", "</span></p>");
System.out.println("Hit");
} else {
text.addMarkup(0, 0, "",
MessageFormat.format("<p class=\"line\"><a class=\"linenumber\" id=\"L{0}\" href=\"#L{0}\"></a><span>", calls));
text.addMarkup(end, end, "", "</span></p>");
}
}
return this;
}

}
}
@@ -42,11 +42,17 @@ p.line {
font-family:monospace;
}

p.empty {
display:block;
white-space:nowrap;
font-family:monospace;
}

pre p,pre span {
margin: 0;
padding: 0;
}

pre p.line:hover {
background-color: rgb(200, 200, 200) !important;
}
}

0 comments on commit 7aaec1c

Please sign in to comment.