Skip to content
Permalink
Browse files
[JENKINS-33105] Refactor and simplify a bit
  • Loading branch information
Vlatombe committed Aug 28, 2017
1 parent 6daedb0 commit 8953d290c3f44ded403a5b7b03187650cca4d994
@@ -58,17 +58,13 @@ public ConsoleAnnotator annotate(Object context, MarkupText text) {
if (start <= 0) { // only annotate if we are handling the full log
calls++;
int end = text.length() - 1;

String cssClasses = "line";
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>");
} 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>");
cssClasses = cssClasses + " empty";
}
text.addMarkup(0, 0, "", MessageFormat.format("<p class=\"{1}\"><a class=\"linenumber\" id=\"L{0}\" href=\"#L{0}\"></a><span>", calls, cssClasses));
text.addMarkup(end, end, "", "</span></p>");
}
return this;
}
@@ -42,10 +42,8 @@ p.line {
font-family:monospace;
}

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

pre p,pre span {

0 comments on commit 8953d29

Please sign in to comment.