summary refs log tree commit diff
path: root/bin
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2019-02-07 01:07:14 -0500
committerJune McEnroe <june@causal.agency>2019-02-07 01:07:14 -0500
commit39029ea12d8defee42e4c404c77f44c7e5b5a042 (patch)
treecd00afc567f6bba3d5656c5873e1de5d461a89af /bin
parentCheck subexpressions with hi -c (diff)
downloadsrc-39029ea12d8defee42e4c404c77f44c7e5b5a042.tar.gz
src-39029ea12d8defee42e4c404c77f44c7e5b5a042.zip
Set class="hi" on <pre>
Diffstat (limited to 'bin')
-rw-r--r--bin/hi.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/bin/hi.c b/bin/hi.c
index 40f873d0..2dd210e7 100644
--- a/bin/hi.c
+++ b/bin/hi.c
@@ -36,8 +36,6 @@ enum Class {
 	ClassCount,
 };
 
-enum { SubsLen = 8 };
-
 struct Syntax {
 	enum Class class;
 	size_t subexp;
@@ -79,6 +77,7 @@ static regex_t compile(const char *pattern, int flags) {
 	errx(EX_SOFTWARE, "regcomp: %s: %s", buf, pattern);
 }
 
+enum { SubsLen = 8 };
 static void highlight(struct Language lang, enum Class *hi, const char *str) {
 	for (size_t i = 0; i < lang.len; ++i) {
 		struct Syntax syn = lang.syntax[i];
@@ -148,7 +147,7 @@ static void ansiOutput(enum Class class, const char *str, size_t len) {
 
 static void htmlHeader(const char *path) {
 	(void)path;
-	printf("<pre>");
+	printf("<pre class=\"hi\">");
 }
 static void htmlFooter(const char *path) {
 	(void)path;