X-Git-Url: http://git.nikiroo.be/?p=gofetch.git;a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Fgofetch%2Foutput%2FGopher.java;h=6dcb4aa8b284777bff8338c530e83d225e8b0ba5;hp=3fa6035c328d3f0731f5bc3a81ce7e38f3220abb;hb=27008a8782c0ed96e07c8dc39ff0ed1f5163a9d0;hpb=93e09a08a68ffd69eed42ecbf95f317b518357d7 diff --git a/src/be/nikiroo/gofetch/output/Gopher.java b/src/be/nikiroo/gofetch/output/Gopher.java index 3fa6035..6dcb4aa 100644 --- a/src/be/nikiroo/gofetch/output/Gopher.java +++ b/src/be/nikiroo/gofetch/output/Gopher.java @@ -65,13 +65,30 @@ public class Gopher extends Output { space = space.substring(0, LINE_SIZE - 20); } - appendLeft(builder, comment.getTitle(), ">> ", " ", space); + appendLeft(builder, comment.getTitle(), "** ", " ", space); appendLeft(builder, "(" + comment.getAuthor() + ")", " ", " ", space); builder.append("i\r\n"); - appendLeft(builder, comment.getContent(), " ", " ", space); + for (String line : comment.getContentLines()) { + int depth = 0; + while (line.length() > depth && line.charAt(depth) == '>') { + depth++; + } + line = line.substring(depth).trim(); + + String prep = " "; + for (int i = 0; i < depth; i++) { + prep += ">"; + } + + if (depth > 0) { + prep += " "; + } + + appendLeft(builder, line, prep, prep, space); + } builder.append("i\r\n"); for (Comment subComment : comment) {