From 12f0a2b1c3a0817656ac8d7fd80335e260e90a4e Mon Sep 17 00:00:00 2001 From: Curtis 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 e5f05bbf..68a2f03d 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