commit 2f42979a84bc89faf94118a4d34094a5b5b73484
parent ca2884479776120856d6f26a7ec6b27a99f4b1e9
Author: Tomas Hlavaty <tom@logand.com>
Date: Tue, 6 Sep 2011 09:20:47 +0200
bold section headers added
Diffstat:
1 file changed, 11 insertions(+), 0 deletions(-)
diff --git a/text2html.c b/text2html.c
@@ -81,6 +81,7 @@ int main() {
char buf[BLEN];
char *end = buf + BLEN;
int n;
+ int bold = 0;
puts("<pre>");
while(0 < (n = line(buf, end))) {
char *b = buf;
@@ -91,6 +92,16 @@ int main() {
else if(head("END", b, e)) {
printf("</div>");
}
+ else if(head("\f\n", b, e)) {
+ if(bold) printf("</div>");
+ puts("<div style=\"font-weight:bold\">");
+ bold = 1;
+ }
+ else if(bold && (tail("\n=", b, e) || tail("\n-", b, e))) {
+ rest(b, e);
+ printf("</div>");
+ bold = 0;
+ }
else if(head("> ", b, e)) {
printf("<span style=\"color:red\">");
rest(b, e);