[tor-commits] [doctor/java] Replace <br> with newline in relay list and format with CSS.

karsten at torproject.org karsten at torproject.org
Sun Apr 20 10:21:22 UTC 2014


commit ea9196ead7f06176bd2860102b43947d9166b662
Author: Michael Wolf <mikewolf at riseup.net>
Date:   Sun Apr 20 03:39:29 2014 -0400

    Replace <br> with newline in relay list and format with CSS.
    
    * Implements part 4 of ticket #11563
---
 src/org/torproject/doctor/MetricsWebsiteReport.java |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/org/torproject/doctor/MetricsWebsiteReport.java b/src/org/torproject/doctor/MetricsWebsiteReport.java
index f6f59f8..28d9e9a 100644
--- a/src/org/torproject/doctor/MetricsWebsiteReport.java
+++ b/src/org/torproject/doctor/MetricsWebsiteReport.java
@@ -130,6 +130,9 @@ public class MetricsWebsiteReport {
         +       "height:3em;\n"
         +       "vertical-align:bottom;\n"
         +     "}\n"
+        +     "#relay-list td {\n"
+        +       "white-space:pre;\n"
+        +     "}\n"
         +   "</style>\n"
         +     "<div class=\"center\">\n"
         +       "<div class=\"main-column\">\n"
@@ -678,7 +681,7 @@ public class MetricsWebsiteReport {
         +         "</ul>\n"
         +         "<br>\n"
         +         "<table border=\"0\" cellpadding=\"4\" "
-        + "cellspacing=\"0\" summary=\"\">\n"
+        + "cellspacing=\"0\" id=\"relay-list\" summary=\"\">\n"
         +           "<colgroup>\n"
         +             "<col width=\"120\">\n"
         +             "<col width=\"80\">\n");
@@ -759,7 +762,7 @@ public class MetricsWebsiteReport {
         this.bw.write("<td>");
         int flagsWritten = 0;
         for (String flag : relevantFlags) {
-          this.bw.write(flagsWritten++ > 0 ? "<br>" : "");
+          this.bw.write(flagsWritten++ > 0 ? "\n" : "");
           if (flags.contains(flag)) {
             if (consensusFlags == null ||
               consensusFlags.contains(flag)) {



More information about the tor-commits mailing list