From 47940e2a528e30903c68abb6c0246cb86772d389 Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Tue, 12 Jan 2021 21:40:11 -0500 Subject: Remove hacky tagging from hilex God that makes the lexers so much simpler. --- bin/hilex/html.c | 41 +++++++++-------------------------------- 1 file changed, 9 insertions(+), 32 deletions(-) (limited to 'bin/hilex/html.c') diff --git a/bin/hilex/html.c b/bin/hilex/html.c index 00c6740e..59914d06 100644 --- a/bin/hilex/html.c +++ b/bin/hilex/html.c @@ -39,9 +39,8 @@ static const char *Class[ClassCap] = { #undef X }; -static const char *Style[ClassCap] = { +static const char *Styles[ClassCap] = { [Keyword] = "color: dimgray;", - [IdentifierTag] = "color: inherit;", [Macro] = "color: green;", [Comment] = "color: navy;", [String] = "color: teal;", @@ -64,9 +63,9 @@ static void htmlHeader(const char *opts[]) { if (opts[Title]) htmlEscape(opts[Title]); printf("\n"); - if (opts[CSS]) { + if (opts[Style]) { printf("\n"); } else if (!opts[Inline]) { printf("\n"); } @@ -103,33 +96,17 @@ static void htmlFooter(const char *opts[]) { if (opts[Document]) printf("\n"); } -static void htmlAnchor(const char *opts[], const char *text) { - if (opts[Inline]) { - printf(""); - htmlEscape(text); - printf(""); -} - static void htmlFormat(const char *opts[], enum Class class, const char *text) { - if (opts[Anchor] && class == IdentifierTag) { - htmlAnchor(opts, text); - } else if (class == Normal) { - htmlEscape(text); - } else { + if (class != Normal) { if (opts[Inline]) { - printf("", Style[class] ? Style[class] : ""); + printf("", Styles[class] ? Styles[class] : ""); } else { printf("", Class[class]); } htmlEscape(text); printf(""); + } else { + htmlEscape(text); } } -- cgit 1.4.1