Permalink
Browse files

It (almost) works. The output is HTML-encoded :(

  • Loading branch information...
dblock committed Sep 3, 2011
1 parent 3963bff commit 4084b9235f8cd2368fa24bb9c735a3170fcde3ca
@@ -74,11 +74,11 @@ protected void processAttributeRest() throws IOException {
@Override
protected void processSetForegroundColor(int color) throws IOException {
writeAttribute("font color=\"" + ANSI_COLOR_MAP[color] + "\"");
writeAttribute("span style=\"color: " + ANSI_COLOR_MAP[color] + ";\"");
}
@Override
protected void processSetBackgroundColor(int color) throws IOException {
writeAttribute("span style=\"background-color: " + ANSI_COLOR_MAP[color] + "\"");
writeAttribute("span style=\"background-color: " + ANSI_COLOR_MAP[color] + ";\"");
}
}
@@ -59,14 +59,14 @@ public void testBold() throws IOException {
@Test
public void testGreen() throws IOException {
assertThat(colorize("hello world"),
is("<font color=\"green\">hello world</font>"));
is("<span style=\"color: green;\">hello world</span>"));
}
@Test
public void testGreenOnWhite() throws IOException {
assertThat(
colorize("hello world"),
is("<span style=\"background-color: white\"><font color=\"green\">hello world</font></span>"));
is("<span style=\"background-color: white;\"><span style=\"color: green;\">hello world</span></span>"));
}
private String colorize(String text) throws IOException {

0 comments on commit 4084b92

Please sign in to comment.