aboutsummaryrefslogtreecommitdiffstats
path: root/lint/cli
diff options
context:
space:
mode:
authorTor Norbye <tnorbye@google.com>2012-08-22 14:29:10 -0700
committerTor Norbye <tnorbye@google.com>2012-08-23 18:57:03 -0700
commitaddbd7110d87e9f48d854e5ba6a729359110ada8 (patch)
tree87c9109ff5a765e4909983716e1bf06e07dfd407 /lint/cli
parentb52aeca0f2e150d7e7e8ceffa897a7ae1f938724 (diff)
downloadsdk-addbd7110d87e9f48d854e5ba6a729359110ada8.zip
sdk-addbd7110d87e9f48d854e5ba6a729359110ada8.tar.gz
sdk-addbd7110d87e9f48d854e5ba6a729359110ada8.tar.bz2
Use simple markup for bold and monospace in lint issues
The explanation text for issues can now contain some simple markup such as * around sentences for bold and ` for monospace. In the HTML report this is converted to HTML markup using <b> and <code> spans, as well as <a> for http:// links. Change-Id: I875a55a0ab9a61c2e8bb493ad94d5e4d51dd1072
Diffstat (limited to 'lint/cli')
-rw-r--r--lint/cli/src/com/android/tools/lint/HtmlReporter.java10
-rw-r--r--lint/cli/src/com/android/tools/lint/hololike.css7
2 files changed, 10 insertions, 7 deletions
diff --git a/lint/cli/src/com/android/tools/lint/HtmlReporter.java b/lint/cli/src/com/android/tools/lint/HtmlReporter.java
index c3ed9d2..2ab075c 100644
--- a/lint/cli/src/com/android/tools/lint/HtmlReporter.java
+++ b/lint/cli/src/com/android/tools/lint/HtmlReporter.java
@@ -368,8 +368,8 @@ public class HtmlReporter extends Reporter {
}
mWriter.write("</div>\n"); //$NON-NLS-1$
mWriter.write("<div class=\"explanation\">\n"); //$NON-NLS-1$
- String explanation = issue.getExplanation();
- appendEscapedText(explanation, true /* preserve newlines*/);
+ String explanationHtml = issue.getExplanationAsHtml();
+ mWriter.write(explanationHtml);
mWriter.write("\n</div>\n"); //$NON-NLS-1$;
if (issue.getMoreInfo() != null) {
mWriter.write("<br/>"); //$NON-NLS-1$
@@ -400,7 +400,7 @@ public class HtmlReporter extends Reporter {
mWriter.write("Suppressing Warnings and Errors");
mWriter.write("<div class=\"categorySeparator\"></div>\n");//$NON-NLS-1$
mWriter.write("</div>\n"); //$NON-NLS-1$
- appendEscapedText(Main.getSuppressHelp(), true /* preserve newlines*/);
+ appendEscapedText(Main.getSuppressHelp());
mWriter.write('\n');
}
@@ -725,10 +725,6 @@ public class HtmlReporter extends Reporter {
}
private void appendEscapedText(String textValue) throws IOException {
- appendEscapedText(textValue, false);
- }
-
- private void appendEscapedText(String textValue, boolean preserveNewlines) throws IOException {
for (int i = 0, n = textValue.length(); i < n; i++) {
char c = textValue.charAt(i);
if (c == '<') {
diff --git a/lint/cli/src/com/android/tools/lint/hololike.css b/lint/cli/src/com/android/tools/lint/hololike.css
index 5c0080c..c7a4792 100644
--- a/lint/cli/src/com/android/tools/lint/hololike.css
+++ b/lint/cli/src/com/android/tools/lint/hololike.css
@@ -24,6 +24,13 @@ body {
.explanation {
margin-top: 10px;
}
+.explanation b {
+ color: #ffbbbb;
+}
+.explanation code {
+ color: #bebebe;
+ font-family: 'Roboto', Sans-Serif;
+}
pre {
background-color: #282828;
margin: 5px 0px 5px 5px;