X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;ds=sidebyside;f=src%2Fbe%2Fnikiroo%2Fgofetch%2Foutput%2FHtml.java;h=50fe2d7fac8848e50c2efe41929567e2fa92c15c;hb=59eb1223bbbf1bafa53360ba6e0c5cfa55aec14b;hp=cdc77a461056887ef1cafad7e6abf7d19019d1ab;hpb=ab07d4d58703383a89b4849cf2e62231b3f80b98;p=gofetch.git diff --git a/src/be/nikiroo/gofetch/output/Html.java b/src/be/nikiroo/gofetch/output/Html.java index cdc77a4..50fe2d7 100644 --- 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; - + StringBuilder builder = new StringBuilder(); appendPre(builder); @@ -28,9 +28,9 @@ public class Html extends Output { + ".

\n"// + "

They are simply scrapped from their associated webpage and updated a few times a day.

\n"// ); - + appendPost(builder); - + return builder.toString(); } @@ -99,10 +99,13 @@ public class Html extends Output { .append("
\n"); builder.append(space).append("

").append(comment.getTitle()) .append("

\n"); - builder.append(space).append("
") + builder.append(space).append("
") .append(comment.getAuthor()).append("
\n"); - builder.append(space).append("
") - .append(comment.getContent()).append("
\n"); + builder.append(space).append("
"); + for (String line : comment.getContentLines()) { + builder.append("

" + line + "

"); + } + builder.append("
\n"); for (Comment subComment : comment) { appendHtml(builder, subComment, space + " "); } @@ -117,8 +120,12 @@ public class Html extends Output { } else { builder.append("

" + story.getTitle() + "

\n"); } - builder.append("
(" + story.getDetails() - + ")
\n"); + + builder.append("
"); + if (story.getDetails() != null && !story.getDetails().isEmpty()) { + builder.append("(").append(story.getDetails()).append(")"); + } + builder.append("
\n"); builder.append("
\n"); if (!resume) { @@ -137,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", "
") + .replace("[ ", "

").replace(" ]", "

") + + "\n"); } builder.append("
\n");