summary refs log tree commit diff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to '')
-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;");
3edbb6047253e168d1814cd3&follow=1'>Use separate edit buffers for each IDJune McEnroe 2022-02-20Make sure new cap is actually larger than new lengthJune McEnroe 2022-02-20Remove unused mbs.len field from struct EditJune McEnroe 2022-02-19Remove unneeded includes in ui.cJune McEnroe 2022-02-19Reimplement tab completeJune McEnroe 2022-02-19Handle errors from editFn, etc.June McEnroe 2022-02-19Reimplement text macrosJune McEnroe 2022-02-19Factor out input handling to input.cJune McEnroe 2022-02-19Factor out window management to window.cJune McEnroe 2022-02-19Enable -Wmissing-prototypesJune McEnroe 2022-02-19Fix edit.[ch] license notice additional permissionsJune McEnroe 2022-02-19Run line editing testsJune McEnroe 2022-02-18Implement new line editing "library"June McEnroe 2022-02-18Simplify cursor positioning in inputJune McEnroe 2022-02-18Fix M-f orderingJune McEnroe 2022-02-12Move sandman build to scripts/MakefileJune McEnroe 2022-02-12Use compat_readpassphrase.c on LinuxJune McEnroe 2022-02-12Copy RPP defines from oconfigureJune McEnroe