From bd985953cf8c45a7d9a92ece8a986975c3ac496a Mon Sep 17 00:00:00 2001 From: June McEnroe Date: Thu, 11 Jul 2019 17:43:40 -0400 Subject: Use inline style rather than , , --- bin/shotty.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'bin') diff --git a/bin/shotty.c b/bin/shotty.c index 765be47d..8a08fbe5 100644 --- a/bin/shotty.c +++ b/bin/shotty.c @@ -232,18 +232,16 @@ 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) { - if (prev->bold) printf(""); - if (prev->italic) printf(""); - if (prev->underline) printf(""); - printf(""); - } + if (prev) printf(""); uint bg = (cell->style.reverse ? cell->style.fg : cell->style.bg); uint fg = (cell->style.reverse ? cell->style.bg : cell->style.fg); - printf("", bg, fg); - if (cell->style.bold) printf(""); - if (cell->style.italic) printf(""); - if (cell->style.underline) printf(""); + printf( + "", + cell->style.bold ? "font-weight:bold;" : "", + cell->style.italic ? "font-style:italic;" : "", + cell->style.underline ? "text-decoration:underline;" : "", + bg, fg + ); } switch (cell->ch) { break; case '&': printf("&"); -- cgit 1.4.1