HTML style change (author in italics)
[gofetch.git] / src / be / nikiroo / gofetch / output / Html.java
index 33c99c81f8874d4a8b249dddee43e0f56ff69a0c..50fe2d7fac8848e50c2efe41929567e2fa92c15c 100644 (file)
@@ -99,7 +99,7 @@ public class Html extends Output {
                                .append("<div class='comment' style='display: block; margin-left: 80px'>\n");
                builder.append(space).append("  <h2>").append(comment.getTitle())
                                .append("</h2>\n");
-               builder.append(space).append("  <div class='by'>")
+               builder.append(space).append("  <div class='by' style='font-style: italic;'>")
                                .append(comment.getAuthor()).append("</div>\n");
                builder.append(space).append("  <div class='comment_content'>");
                for (String line : comment.getContentLines()) {
@@ -120,8 +120,12 @@ public class Html extends Output {
                } else {
                        builder.append("        <h1>" + story.getTitle() + "</h1>\n");
                }
-               builder.append("        <div class='details'>(" + story.getDetails()
-                               + ")</div>\n");
+
+               builder.append("        <div class='details'>");
+               if (story.getDetails() != null && !story.getDetails().isEmpty()) {
+                       builder.append("(").append(story.getDetails()).append(")");
+               }
+               builder.append("</div>\n");
                builder.append("        <br/>\n");
 
                if (!resume) {
@@ -140,7 +144,10 @@ public class Html extends Output {
                if (resume) {
                        builder.append("                " + story.getContent() + "\n");
                } else {
-                       builder.append("                " + story.getFullContent() + "\n");
+                       builder.append("                "
+                                       + story.getFullContent().replace("\n", "<br/>")
+                                                       .replace("[ ", "<h2>").replace(" ]", "</h2>")
+                                       + "\n");
                }
                builder.append("        </div>\n");