diff options
author | June McEnroe <june@causal.agency> | 2021-01-12 22:24:33 -0500 |
---|---|---|
committer | June McEnroe <june@causal.agency> | 2021-01-12 22:24:33 -0500 |
commit | a76cc474b8765c547ea033095b8d170cd0f60845 (patch) | |
tree | 2b1774328afaee992c92bc253726388776da0cb9 /bin/hilex.c | |
parent | Move hilex out of hilex directory (diff) | |
download | src-a76cc474b8765c547ea033095b8d170cd0f60845.tar.gz src-a76cc474b8765c547ea033095b8d170cd0f60845.zip |
Don't output a pre in hilex by default
Diffstat (limited to '')
-rw-r--r-- | bin/hilex.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/bin/hilex.c b/bin/hilex.c index ccbfa8ad..afcc5000 100644 --- a/bin/hilex.c +++ b/bin/hilex.c @@ -71,6 +71,7 @@ static const struct Lexer *matchLexer(const char *name) { X(Document, "document") \ X(Inline, "inline") \ X(Monospace, "monospace") \ + X(Pre, "pre") \ X(Style, "style") \ X(Tab, "tab") \ X(Title, "title") @@ -207,17 +208,17 @@ static void htmlHeader(const char *opts[]) { } body: - if (opts[Inline] && opts[Tab]) { + if ((opts[Document] || opts[Pre]) && opts[Inline] && opts[Tab]) { printf("<pre class=\"hilex\" style=\""); styleTabSize(opts[Tab]); printf("\">"); - } else { + } else if (opts[Document] || opts[Pre]) { printf("<pre class=\"hilex\">"); } } static void htmlFooter(const char *opts[]) { - printf("</pre>"); + if (opts[Document] || opts[Pre]) printf("</pre>"); if (opts[Document]) printf("\n"); } |