Fix html (gopher links with selectors, useless BR)
authorNiki Roo <niki@nikiroo.be>
Sun, 6 Aug 2017 11:39:03 +0000 (13:39 +0200)
committerNiki Roo <niki@nikiroo.be>
Sun, 6 Aug 2017 11:39:03 +0000 (13:39 +0200)
src/be/nikiroo/gofetch/output/Html.java

index c087ef24d91ced582827d5cac32f9dcf8574424f..fea5f67997c0b36ad3f45734051a32ce6d16d911 100644 (file)
@@ -13,16 +13,19 @@ public class Html extends Output {
 
        @Override
        public String getIndexHeader() {
-               String gopherUrl = "gopher://" + hostname + preselector + ":" + port;
+               String sel = preselector;
+               if (!sel.isEmpty()) {
+                       sel = "/1" + sel;
+               }
+               
+               String gopherUrl = "gopher://" + hostname + sel + ":" + port;
 
                return "<h1>News</h1>\n"//
                                + "<p>You will find here a few pages full of news, mirroring <a href='"
                                + gopherUrl + "'>"
                                + gopherUrl
                                + "</a>.</p>\n"//
-                               + "<br/>\n"//
                                + "<p>They are simply scrapped from their associated webpage and updated a few times a day.</p>\n"//
-                               + "<br/>\n"//
                ;
        }