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;");
>html: remove redundant htmlfd variableJohn Keeping 2014-01-12tests: add Valgrind supportJohn Keeping 2014-01-12cache: don't leave cache_slot fields uninitializedJohn Keeping 2014-01-10filter: split filter functions into their own fileJason A. Donenfeld 2014-01-10filter: make exit status localJason A. Donenfeld 2014-01-10parsing: fix header typoJason A. Donenfeld 2014-01-10cgit.c: Fix comment on bit mask hackLukas Fleischer 2014-01-10cgit.c: Use "else" for mutually exclusive branchesLukas Fleischer 2014-01-10ui-snapshot.c: Do not reinvent suffixcmp()Lukas Fleischer 2014-01-10Refactor cgit_parse_snapshots_mask()Lukas Fleischer 2014-01-10Disallow use of undocumented snapshot delimitersLukas Fleischer 2014-01-10Replace most uses of strncmp() with prefixcmp()Lukas Fleischer 2014-01-09README: Fix dependenciesLukas Fleischer 2014-01-08README: Spelling and formatting fixesLukas Fleischer 2014-01-08Fix UTF-8 with syntax-highlighting.pyPřemysl Janouch 2014-01-08Add a suggestion to the manpagePřemysl Janouch 2014-01-08Fix the example configurationPřemysl Janouch 2014-01-08Fix about-formatting.shPřemysl Janouch 2014-01-08Fix some spelling errorsPřemysl Janouch 2014-01-08filters: highlight.sh: add css comments for highlight 2.6 and 3.8Ferry Huberts