git://git.nikiroo.be
/
gofetch.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
HTML style change (author in italics)
[gofetch.git]
/
src
/
be
/
nikiroo
/
gofetch
/
output
/
Html.java
diff --git
a/src/be/nikiroo/gofetch/output/Html.java
b/src/be/nikiroo/gofetch/output/Html.java
index cdc77a461056887ef1cafad7e6abf7d19019d1ab..50fe2d7fac8848e50c2efe41929567e2fa92c15c 100644
(file)
--- a/
src/be/nikiroo/gofetch/output/Html.java
+++ b/
src/be/nikiroo/gofetch/output/Html.java
@@
-17,7
+17,7
@@
public class Html extends Output {
}
String gopherUrl = "gopher://" + hostname + sel + ":" + port;
}
String gopherUrl = "gopher://" + hostname + sel + ":" + port;
-
+
StringBuilder builder = new StringBuilder();
appendPre(builder);
StringBuilder builder = new StringBuilder();
appendPre(builder);
@@
-28,9
+28,9
@@
public class Html extends Output {
+ "</a>.</p>\n"//
+ "<p>They are simply scrapped from their associated webpage and updated a few times a day.</p>\n"//
);
+ "</a>.</p>\n"//
+ "<p>They are simply scrapped from their associated webpage and updated a few times a day.</p>\n"//
);
-
+
appendPost(builder);
appendPost(builder);
-
+
return builder.toString();
}
return builder.toString();
}
@@
-99,10
+99,13
@@
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");
.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");
.append(comment.getAuthor()).append("</div>\n");
- builder.append(space).append(" <div class='comment_content'>")
- .append(comment.getContent()).append("</div>\n");
+ builder.append(space).append(" <div class='comment_content'>");
+ for (String line : comment.getContentLines()) {
+ builder.append("<p>" + line + "</p>");
+ }
+ builder.append("</div>\n");
for (Comment subComment : comment) {
appendHtml(builder, subComment, space + " ");
}
for (Comment subComment : comment) {
appendHtml(builder, subComment, space + " ");
}
@@
-117,8
+120,12
@@
public class Html extends Output {
} else {
builder.append(" <h1>" + story.getTitle() + "</h1>\n");
}
} 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) {
builder.append(" <br/>\n");
if (!resume) {
@@
-137,7
+144,10
@@
public class Html extends Output {
if (resume) {
builder.append(" " + story.getContent() + "\n");
} else {
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");
}
builder.append(" </div>\n");