From ff43ade74b8e788b28a4eb74b1b688f803d30e8c Mon Sep 17 00:00:00 2001 From: June McEnroe Date: Thu, 11 Jul 2019 17:11:39 -0400 Subject: Output , , in shotty --- bin/shotty.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'bin/shotty.c') diff --git a/bin/shotty.c b/bin/shotty.c index 234cd07f..15ab3e4d 100644 --- a/bin/shotty.c +++ b/bin/shotty.c @@ -231,15 +231,18 @@ static void update(wchar_t ch) { static void html(const struct Style *prev, const struct Cell *cell) { if (!prev || memcmp(&cell->style, prev, sizeof(cell->style))) { - if (prev) printf(""); - printf("style.bold) printf("bold "); - if (cell->style.italic) printf("italic "); - if (cell->style.underline) printf("underline "); + if (prev) { + if (prev->bold) printf(""); + if (prev->italic) printf(""); + if (prev->underline) printf(""); + printf(""); + } uint bg = (cell->style.reverse ? cell->style.fg : cell->style.bg); uint fg = (cell->style.reverse ? cell->style.bg : cell->style.fg); - if (cell->style.bold && fg < 8) fg += 8; - printf("bg%u fg%u\">", bg, fg); + printf("", bg, fg); + if (cell->style.bold) printf(""); + if (cell->style.italic) printf(""); + if (cell->style.underline) printf(""); } switch (cell->ch) { break; case '&': printf("&"); -- cgit 1.4.1