Closed Osiris-Team closed 3 years ago
There's no plan to bring it back at the moment, I don't think it's used enough.
@gnodet Im planning to write something for converting ansi to html. Is there a way you would recommend how to tackle that?
@gnodet I was thinking of something like this:
public class UtilsAnsiHtml {
public String convertAnsiToHtml(Ansi ansi) throws IOException {
StringBuilder builder = new StringBuilder();
builder.append("<ansi>");
String ansiString = ansi.toString();
for (int i = 0; i < ansiString.length(); i++) {
int currentCodePoint = ansiString.codePointAt(i);
// TODO parse ansi
}
builder.append("</ansi>");
return builder.toString();
}
}
Then go through each char of the ansi string and convert it to html...
@Osiris-Team I guess you should be able to adapt the HtmlAnsiOutputStream
(https://github.com/fusesource/jansi/blob/jansi-1.x/jansi/src/main/java/org/fusesource/jansi/HtmlAnsiOutputStream.java) to the recent AnsiOutputStream
from 2.x.
@Osiris-Team I guess you should be able to adapt the
HtmlAnsiOutputStream
(https://github.com/fusesource/jansi/blob/jansi-1.x/jansi/src/main/java/org/fusesource/jansi/HtmlAnsiOutputStream.java) to the recentAnsiOutputStream
from 2.x.
Yeah guess that should be easier haha
@gnodet What is the difference between this: https://github.com/fusesource/jansi/blob/b7c7fbda5b19d5ad9f761e88bb06da8177cdc83e/src/main/java/org/fusesource/jansi/io/AnsiOutputStream.java#L88 and this: https://github.com/fusesource/jansi/blob/b7c7fbda5b19d5ad9f761e88bb06da8177cdc83e/src/main/java/org/fusesource/jansi/io/AnsiOutputStream.java#L78 ?
Is it ever coming back, or should I create a new one by myself?