summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--bin/shotty.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/bin/shotty.c b/bin/shotty.c
index 304be444..d4a7b160 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("</span>");
-		printf("<span class=\"");
-		if (cell->style.bold) printf("bold ");
-		if (cell->style.italic) printf("italic ");
-		if (cell->style.underline) printf("underline ");
+		if (prev) {
+			if (prev->bold) printf("</b>");
+			if (prev->italic) printf("</i>");
+			if (prev->underline) printf("</u>");
+			printf("</span>");
+		}
 		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("<span class=\"bg%u fg%u\">", bg, fg);
+		if (cell->style.bold) printf("<b>");
+		if (cell->style.italic) printf("<i>");
+		if (cell->style.underline) printf("<u>");
 	}
 	switch (cell->ch) {
 		break; case '&': printf("&amp;");
'/catsit/commit/catsitd.8?h=1.3&id=470e1ec7b65a59fe3f66cbbdb29abc4f4b7dccb9&follow=1'>Avoid "control named pipe" phraseJune McEnroe 2020-08-15Check if pipe is writable in wrapperJune McEnroe 2020-08-15Parse config laterJune McEnroe 2020-08-15Only log signals other than SIGTERMJune McEnroe 2020-08-15Clarify restart interval in catsitd manualJune McEnroe 2020-08-15Fix resetting restart interval with explicit restartJune McEnroe 2020-08-15Add reset interval after which restart interval is resetJune McEnroe 2020-08-15Log when service name pattern doesn't matchJune McEnroe 2020-08-15Add FreeBSD rc scriptJune McEnroe 2020-08-15Call setproctitle with number of servicesJune McEnroe 2020-08-15Rename project to catsitJune McEnroe 2020-08-15Use only LOG_NOTICE and LOG_WARNINGJune McEnroe 2020-08-15Make log messages consistentJune McEnroe 2020-08-15Remove closelog callJune McEnroe 2020-08-15Implement service statusJune McEnroe 2020-08-15Parse control commandsJune McEnroe 2020-08-15Read service pipesJune McEnroe 2020-08-15Implement non-blocking line-buffered readingJune McEnroe 2020-08-15Generate tags fileJune McEnroe 2020-08-15Just use CLOCK_MONOTONIC and clean up includesJune McEnroe 2020-08-15Reap childrenJune McEnroe 2020-08-14Implement serviceSignal, serviceStop, serviceRestartJune McEnroe 2020-08-14Reset restartInterval and restartDeadline on startJune McEnroe 2020-08-14Switch to timespec for timeoutsJune McEnroe 2020-08-14Implement serviceStartJune McEnroe 2020-08-14Flesh out Service structJune McEnroe 2020-08-14Build environment for servicesJune McEnroe 2020-08-14Implement spawntab parsingJune McEnroe 2020-08-14Open syslog, daemonize, write PIDJune McEnroe 2020-08-14Implement user and group lookupJune McEnroe 2020-08-14Add install targetJune McEnroe 2020-08-14Add spawnd skeletonJune McEnroe