summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2019-02-18 17:29:49 -0500
committerJune McEnroe <june@causal.agency>2019-02-18 17:29:49 -0500
commit70b7d640b2ac1ccfa5ce7689743206aedbfffb43 (patch)
treee1a297acea20bd27ad83e279a9282f73c11aa8c7
parentRemove hi line numbering (diff)
downloadsrc-70b7d640b2ac1ccfa5ce7689743206aedbfffb43.tar.gz
src-70b7d640b2ac1ccfa5ce7689743206aedbfffb43.zip
Clean up htmlHeader
Diffstat (limited to '')
-rw-r--r--bin/hi.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/bin/hi.c b/bin/hi.c
index 15dcd4a2..a96ab902 100644
--- a/bin/hi.c
+++ b/bin/hi.c
@@ -500,7 +500,7 @@ static void htmlTabSize(const char *tab) {
 }
 
 static void htmlHeader(const char *opts[]) {
-	if (!opts[Document]) goto pre;
+	if (!opts[Document]) goto body;
 	printf("<!DOCTYPE html>\n<title>");
 	if (opts[Title]) htmlEscape(opts[Title], strlen(opts[Title]));
 	printf("</title>\n");
@@ -515,17 +515,17 @@ static void htmlHeader(const char *opts[]) {
 			htmlTabSize(opts[Tab]);
 			printf(" }\n");
 		}
-		printf(
-			".hi.%s:focus { outline-style: none; color: goldenrod; }",
-			ClassName[Tag]
-		);
 		for (enum Class class = 0; class < ClassLen; ++class) {
 			if (!HTMLStyle[class]) continue;
 			printf(".hi.%s { %s }\n", ClassName[class], HTMLStyle[class]);
 		}
+		printf(
+			".hi.%s:focus { color: goldenrod; outline: none; }\n",
+			ClassName[Tag]
+		);
 		printf("</style>\n");
 	}
-pre:
+body:
 	if (opts[Inline] && opts[Tab]) {
 		printf("<pre class=\"hi\" style=\"");
 		htmlTabSize(opts[Tab]);
@@ -540,7 +540,7 @@ static void htmlFooter(const char *opts[]) {
 	printf("</pre>\n");
 }
 
-static void htmlAnchorTag(const char *opts[], const char *str, size_t len) {
+static void htmlAnchor(const char *opts[], const char *str, size_t len) {
 	if (opts[Inline]) {
 		printf("<a style=\"%s\" id=\"", HTMLStyle[Tag] ? HTMLStyle[Tag] : "");
 	} else {
@@ -557,7 +557,7 @@ static void htmlAnchorTag(const char *opts[], const char *str, size_t len) {
 static void
 htmlOutput(const char *opts[], enum Class class, const char *str, size_t len) {
 	if (opts[Anchor] && class == Tag) {
-		htmlAnchorTag(opts, str, len);
+		htmlAnchor(opts, str, len);
 		return;
 	}
 	if (opts[Inline]) {