summary refs log tree commit diff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rw-r--r--bin/shotty.l5
1 files changed, 3 insertions, 2 deletions
diff --git a/bin/shotty.l b/bin/shotty.l
index e9edb515..8018d785 100644
--- a/bin/shotty.l
+++ b/bin/shotty.l
@@ -493,7 +493,8 @@ static void span(const struct Cell *prev, const struct Cell *cell) {
 			if (fg < 8) fg += 8;
 			attr &= ~Bold;
 		}
-		printf(Q(<span class="bg%d fg%d" style=) "\"", bg, fg);
+		printf(Q(<span class="bg%d fg%d"), bg, fg);
+		if (attr || colors) printf(" style=\"");
 		if (attr & Bold) printf("font-weight:bold;");
 		if (attr & Italic) printf("font-style:italic;");
 		if (attr & Underline) printf("text-decoration:underline;");
@@ -503,7 +504,7 @@ static void span(const struct Cell *prev, const struct Cell *cell) {
 				Palette[bg], Palette[fg]
 			);
 		}
-		printf("\">");
+		printf("%s>", (attr || colors ? "\"" : ""));
 	}
 	switch (cell->ch) {
 		break; case L'&': printf("&amp;");