From bc62240584d63bccce790534e12641ec38bb35ad Mon Sep 17 00:00:00 2001
From: Eddy Young <jeyoung@priscimon.com>
Date: Sun, 24 May 2015 04:50:07 -0400
Subject: [PATCH] Reworked NetBeans project to be based on the pom.xml rather than the build.xml.
---
src/main/java/com/gitblit/utils/GitBlitDiffFormatter.java | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/src/main/java/com/gitblit/utils/GitBlitDiffFormatter.java b/src/main/java/com/gitblit/utils/GitBlitDiffFormatter.java
index edaed70..8f0d223 100644
--- a/src/main/java/com/gitblit/utils/GitBlitDiffFormatter.java
+++ b/src/main/java/com/gitblit/utils/GitBlitDiffFormatter.java
@@ -74,6 +74,8 @@
*/
private static final int GLOBAL_DIFF_LIMIT = 20000;
+ private static final boolean CONVERT_TABS = true;
+
private final DiffOutputStream os;
private final DiffStat diffStat;
@@ -150,7 +152,7 @@
{
String binaryDiff = binaryDiffHandler.renderBinaryDiff(formatter.entry);
if (binaryDiff != null) {
- byte[] bb = ("<tr><td colspan='4'>" + binaryDiff + "</td></tr>").getBytes(StandardCharsets.UTF_8);
+ byte[] bb = ("<tr><td colspan='4' align='center'>" + binaryDiff + "</td></tr>").getBytes(StandardCharsets.UTF_8);
super.write(bb, 0, bb.length);
return;
}
@@ -451,14 +453,14 @@
// Highlight trailing whitespace on deleted/added lines.
Matcher matcher = trailingWhitespace.matcher(line);
if (matcher.find()) {
- StringBuilder result = new StringBuilder(StringUtils.escapeForHtml(line.substring(0, matcher.start()), false));
+ StringBuilder result = new StringBuilder(StringUtils.escapeForHtml(line.substring(0, matcher.start()), CONVERT_TABS));
result.append("<span class='trailingws-").append(prefix == '+' ? "add" : "sub").append("'>");
result.append(StringUtils.escapeForHtml(matcher.group(1), false));
result.append("</span>");
return result.toString();
}
}
- return StringUtils.escapeForHtml(line, false);
+ return StringUtils.escapeForHtml(line, CONVERT_TABS);
}
/**
@@ -490,7 +492,7 @@
} else {
sb.append("<th class='diff-state diff-state-sub'></th><td class=\"diff-cell remove2\">");
}
- line = StringUtils.escapeForHtml(line.substring(1), false);
+ line = StringUtils.escapeForHtml(line.substring(1), CONVERT_TABS);
}
sb.append(line);
if (gitLinkDiff) {
--
Gitblit v1.9.1