From d0e01100a2d59c4fc14918e18475aad0f853b0a0 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Tue, 15 Dec 2015 06:57:17 -0800 Subject: Use lower case for all HTML tags and attributes. --- man2html/man2html.c | 222 ++++++++++++++++++++++++++-------------------------- 1 file changed, 111 insertions(+), 111 deletions(-) diff --git a/man2html/man2html.c b/man2html/man2html.c index ef1fae8..eed6be2 100644 --- a/man2html/man2html.c +++ b/man2html/man2html.c @@ -370,8 +370,8 @@ static int dl_set[30]= { 0 }; #define DL 1 #define UL 2 #define OL 3 -static char *dl_open[4] = { "", "
\n", "
\n", "", "" }; +static char *dl_open[4] = { "", "
\n", "
\n", "", "" }; static inline void dl_begin(void) { @@ -379,7 +379,7 @@ dl_begin(void) { out_html(dl_open[DL]); dl_set[itemdepth]=DL; } - out_html("
"); + out_html("
"); } static inline void @@ -398,14 +398,14 @@ dl_newlevel(void) { itemdepth++; if (itemdepth < SIZE(dl_set)) dl_set[itemdepth]=noDL; - out_html("
"); + out_html("
"); } static inline void dl_endlevel(void) { if (itemdepth) { dl_end(); - out_html("
\n"); + out_html("
\n"); itemdepth--; } } @@ -455,14 +455,14 @@ Bug 2: incorrect font: after the .IP things are roman again. #define FO0 "" #define FC0 "" -#define FO1 "" -#define FC1 "" -#define FO2 "" -#define FC2 "" -#define FO3 "" -#define FC3 "" -#define FO4 "" -#define FC4 "" +#define FO1 "" +#define FC1 "" +#define FO2 "" +#define FC2 "" +#define FO3 "" +#define FC3 "" +#define FO4 "" +#define FC4 "" #define NFONTS 5 @@ -518,11 +518,11 @@ change_to_size(int nr) i=current_font; sizebuf[0]=0; strcat(sizebuf, change_to_font(0)); - if (current_size) strcat(sizebuf, ""); + if (current_size) strcat(sizebuf, ""); current_size=nr; if (nr) { int l; - strcat(sizebuf, "0) sizebuf[l++]='+'; else sizebuf[l++]='-',nr=-nr; sizebuf[l++]=nr+'0'; @@ -710,7 +710,7 @@ scan_escape(char *c) { skip_escape=exskipescape; intresult=j; break; - case 'l': h="
"; curpos=0; + case 'l': h="
"; curpos=0; case 'b': case 'v': case 'x': @@ -733,7 +733,7 @@ scan_escape(char *c) { case 'c': no_newline_output=1; break; case '{': newline_for_fun++; h="";break; case '}': if (newline_for_fun) newline_for_fun--; h="";break; - case 'p': h="
\n";curpos=0; break; + case 'p': h="
\n";curpos=0; break; case 't': h="\t";curpos=(curpos+8)&0xfff8; break; case '<': h="<";curpos++; break; case '>': h=">";curpos++; break; @@ -950,7 +950,7 @@ scan_table(char *c) { out_html(change_to_size(0)); if (!fillout) { fillout=1; - out_html(""); + out_html(""); } while (*h && *h!='\n') h++; if (h[-1]==';') { @@ -1126,45 +1126,45 @@ scan_table(char *c) { currow=currow->prev; } /* produce html output */ - if (center) out_html("
"); - if (box==2) out_html("
"); - out_html(""); + if (box==2) out_html(""); + out_html(""); curfield=currow->first; while (curfield) { if (curfield->align!='S' && curfield->align!='^') { - out_html("align) { case 'N': curfield->space+=4; case 'R': - out_html(" ALIGN=right"); + out_html(" align=right"); break; case 'C': - out_html(" ALIGN=center"); + out_html(" align=center"); default: break; } if (!curfield->valign && curfield->rowspan>1) - out_html(" VALIGN=center"); + out_html(" valign=center"); if (curfield->colspan>1) { char buf[5]; - out_html(" COLSPAN="); + out_html(" colspan="); sprintf(buf, "%i", curfield->colspan); out_html(buf); } if (curfield->rowspan>1) { char buf[5]; - out_html(" ROWSPAN="); + out_html(" rowspan="); sprintf(buf, "%i", curfield->rowspan); out_html(buf); } @@ -1173,8 +1173,8 @@ scan_table(char *c) { if (curfield->size) out_html(change_to_size(curfield->size)); if (curfield->font) out_html(change_to_font(curfield->font)); switch (curfield->align) { - case '=': out_html("

"); break; - case '_': out_html("
"); break; + case '=': out_html("

"); break; + case '_': out_html("
"); break; default: if (curfield->contents) out_html(curfield->contents); break; @@ -1184,20 +1184,20 @@ scan_table(char *c) { if (curfield->font) out_html(change_to_font(0)); if (curfield->size) out_html(change_to_size(0)); if (j>=maxcol && curfield->align>'@' && curfield->align!='_') - out_html("
"); - out_html(""); + out_html("
"); + out_html(""); } curfield=curfield->next; } - out_html("
\n"); + out_html("\n"); currow=currow->next; } - if (box && !border) out_html("
"); + out_html("
\n"); currow=layout; while (currow) { j=0; - out_html("
"); - out_html("
"); - if (box==2) out_html(""); - if (center) out_html("
\n"); + if (box && !border) out_html(""); + out_html(""); + if (box==2) out_html(""); + if (center) out_html("\n"); else out_html("\n"); - if (!oldfillout) out_html("
");
+    if (!oldfillout) out_html("
");
     fillout=oldfillout;
     out_html(change_to_size(oldsize));
     out_html(change_to_font(oldfont));
@@ -1565,12 +1565,12 @@ add_to_index(int level, char *item, char **result)
     while (level != subs) {
 	if (level > subs) {
 	    manidx_need(5);
-	    strcpy(manidx+mip, "
\n"); + strcpy(manidx+mip, "
\n"); mip += 5; subs++; } else { manidx_need(6); - strcpy(manidx+mip, "
\n"); + strcpy(manidx+mip, "
\n"); mip += 6; subs--; } @@ -1578,7 +1578,7 @@ add_to_index(int level, char *item, char **result) out = scan_troff(item, 1, &c); manidx_need(100 + strlen(c)); - sprintf(manidx+mip, "
%s
\n", label, c); + sprintf(manidx+mip, "
%s
\n", label, c); if (result) *result = c; else @@ -1735,8 +1735,8 @@ scan_request(char *c) { nofillout=1; break; case V('b','r'): - if (still_dd) out_html("
"); - else out_html("
\n"); + if (still_dd) out_html("
"); + else out_html("
\n"); curpos=0; c=c+j; if (c[0] == escapesym) { c=scan_escape(c+1); } @@ -1766,17 +1766,17 @@ scan_request(char *c) { c=skip_till_newline(c); /* center next i lines */ if (i>0) { - out_html("
\n"); + out_html("
\n"); while (i && *c) { char *line=NULL; c=scan_troff(c,1, &line); - if (line && strncmp(line, "
", 4)) { + if (line && strncmp(line, "
", 4)) { out_html(line); - out_html("
\n"); + out_html("
\n"); i--; } } - out_html("
\n"); + out_html("
\n"); curpos=0; } break; @@ -1807,7 +1807,7 @@ scan_request(char *c) { if (!fillout) { out_html(change_to_font(0)); out_html(change_to_size('0')); - out_html("
\n"); + out_html("
\n"); } curpos=0; fillout=1; @@ -1920,7 +1920,7 @@ scan_request(char *c) { if (fillout) { out_html(change_to_font(0)); out_html(change_to_size('0')); - out_html("
\n");
+		out_html("
\n");
 	    }
 	    curpos=0;
 	    fillout=0;
@@ -1942,7 +1942,7 @@ scan_request(char *c) {
 	    break;
 	case V('s','p'):
 	    c=c+j;
-	    if (fillout) out_html("

"); else { + if (fillout) out_html("

"); else { out_html(NEWLINE); NEWLINE[0]='\n'; } @@ -1982,10 +1982,10 @@ scan_request(char *c) { if (!t) t=fname; fprintf(stderr, "ln -s %s.html %s.html\n", h, t); s=strrchr(t, '.');if (!s) s=t; - printf(" Manpage of %s\n" - "\n" - "See the manpage for %s.\n" - "\n", + printf(" Manpage of %s\n" + "\n" + "See the manpage for %s.\n" + "\n", s, h, h); } else #endif @@ -1994,10 +1994,10 @@ scan_request(char *c) { if (!l || !(f = fopen(h,"r"))) { fprintf(stderr, "man2html: unable to open or read file %s\n", h); - out_html("

" + out_html("
" "man2html: unable to open or read file\n"); out_html(h); - out_html("
\n"); + out_html("
\n"); } else { i=fread(buf+1,1,l,f); fclose(f); @@ -2029,7 +2029,7 @@ scan_request(char *c) { #if 0 dl_down(); #endif - out_html("
\n"); + out_html("
\n"); c=c+j; c=scan_expression(c, &j); for (i=0; i"); + out_html("
"); curpos = 0; break; case V('T','P'): @@ -2114,7 +2114,7 @@ scan_request(char *c) { /* somewhere a definition ends with '.TP' */ if (!*c) still_dd=1; else { c=scan_troff(c,1,NULL); - out_html("
"); + out_html("
"); } curpos=0; break; @@ -2137,18 +2137,18 @@ scan_request(char *c) { fprintf(idxfile,"\n"); } #endif - out_html("' and '<' solves it, but creates ** some space. A normal space does not work. */ - out_html("\">"); + out_html("\">"); break; case V('L','P'): case V('P','P'): dl_end(); - if (fillout) out_html("

\n"); else { + if (fillout) out_html("

\n"); else { out_html(NEWLINE); NEWLINE[0]='\n'; } @@ -2212,21 +2212,21 @@ scan_request(char *c) { out_html(change_to_size(0)); if (!fillout) { fillout=1; - out_html("

"); + out_html("
"); } trans_char(c,'"', '\a'); h = NULL; c = add_to_index(mode, c, &h); - out_html(" \n

"); - else out_html("\"> \n

"); + if (mode) out_html("\"> \n

"); + else out_html("\"> \n

"); mandoc_synopsis = (strncmp(c, "SYNOPSIS", 8) == 0); out_html(h); free(h); - if (mode) out_html("

\n"); - else out_html("\n"); + if (mode) out_html("\n"); + else out_html("\n"); curpos=0; break; case V4('M','2','S','S'): @@ -2250,9 +2250,9 @@ scan_request(char *c) { h = NULL; (void) add_to_index(i, wordlist[2], &h); wordlist[2] = h; - out_html(" \n<"); + out_html("\"> \n<"); out_html(wordlist[1]); out_html(">"); out_html(wordlist[2]); out_html("\n"); @@ -2272,11 +2272,11 @@ scan_request(char *c) { *sl = 0; if (words > 1) { output_possible=1; - out_html("Manpage of "); + out_html("<html><head><title>Manpage of "); out_html(wordlist[0]); - out_html("\n\n

"); + out_html("\n\n

"); out_html(wordlist[0]); - out_html("

\nSection: "); + out_html("\nSection: "); if (words>4) out_html(wordlist[4]); else @@ -2284,14 +2284,14 @@ scan_request(char *c) { out_html(" ("); out_html(wordlist[1]); if (words>2) { - out_html(")
Updated: "); + out_html(")
Updated: "); scan_troff(wordlist[2], 1, NULL); } else out_html(")"); - out_html("
Index\n"); + out_html("
Index\n"); man_page_html(0,0); /* Return to Main Contents */ *sl='\n'; - out_html("
\n"); - if (mandoc_command) out_html("
BSD mandoc
"); + out_html("
\n"); + if (mandoc_command) out_html("
BSD mandoc
"); } c = sl+1; } else @@ -2459,7 +2459,7 @@ scan_request(char *c) { dl_newlevel_type(DL); if (nl) *nl = t; - if (fillout) out_html("

\n"); else { + if (fillout) out_html("

\n"); else { out_html(NEWLINE); NEWLINE[0]='\n'; } @@ -2470,7 +2470,7 @@ scan_request(char *c) { case V('E','l'): /* BSD mandoc */ c=c+j; dl_endlevel_type(); - if (fillout) out_html("

\n"); else { + if (fillout) out_html("

\n"); else { out_html(NEWLINE); NEWLINE[0]='\n'; } @@ -2480,7 +2480,7 @@ scan_request(char *c) { case V('I','t'): /* BSD mandoc */ c=c+j; if (dl_type(DL)) { - out_html("

"); + out_html("
"); out_html(change_to_font('B')); if (*c == '\n') { /* Don't allow embedded comms after a newline */ @@ -2495,9 +2495,9 @@ scan_request(char *c) { if (inXo) still_dd = 1; else - out_html("
"); + out_html("
"); } else if (dl_type(UL) || dl_type(OL)) { - out_html("
  • "); + out_html("
  • "); c=scan_troff_mandoc(c,1,NULL); out_html(NEWLINE); } @@ -2512,7 +2512,7 @@ scan_request(char *c) { c=c+j; if (inXo) { if (still_dd) - out_html("
    "); + out_html("
    "); inXo = 0; } break; @@ -2547,12 +2547,12 @@ scan_request(char *c) { case V('D','l'): /* BSD mandoc */ c=c+j; out_html(NEWLINE); - out_html("
    "); + out_html("
    "); out_html(change_to_font('L')); if (*c == '\n') c++; c=scan_troff_mandoc(c, 1, NULL); out_html(change_to_font('R')); - out_html("
    "); + out_html("
    "); if (fillout) curpos++; else curpos=0; break; case V('B','d'): /* BSD mandoc */ @@ -2568,14 +2568,14 @@ scan_request(char *c) { mandoc_bd_options = 0; /* Remember options for terminating Bl */ if (strstr(c, "-offset indent")) { mandoc_bd_options |= BD_INDENT; - out_html("
    \n"); + out_html("
    \n"); } if (strstr(c, "-literal") || strstr(c, "-unfilled")) { if (fillout) { mandoc_bd_options |= BD_LITERAL; out_html(change_to_font(0)); out_html(change_to_size('0')); - out_html("
    \n");
    +		       out_html("
    \n");
     		  }
     		  curpos=0;
     		  fillout=0;
    @@ -2590,18 +2590,18 @@ scan_request(char *c) {
     		  if (!fillout) {
     		       out_html(change_to_font(0));
     		       out_html(change_to_size('0'));
    -		       out_html("
    \n"); + out_html("
    \n"); } } if (mandoc_bd_options & BD_INDENT) - out_html("
    \n"); + out_html("
    \n"); curpos=0; fillout=1; c=skip_till_newline(c); break; case V('B','e'): /* BSD mandoc */ c=c+j; - if (fillout) out_html("

    "); else { + if (fillout) out_html("

    "); else { out_html(NEWLINE); NEWLINE[0]='\n'; } @@ -2668,7 +2668,7 @@ scan_request(char *c) { if (fillout) curpos++; else curpos=0; break; case V('P','p'): /* BSD mandoc */ - if (fillout) out_html("

    \n"); else { + if (fillout) out_html("

    \n"); else { out_html(NEWLINE); NEWLINE[0]='\n'; } @@ -2808,7 +2808,7 @@ scan_request(char *c) { */ static int count = 0; /* Don't break on the first Nm */ if (count) { - out_html("
    "); + out_html("
    "); } else { char *end, t=0 /* just for gcc */; end = strchr(c, '\n'); @@ -3035,7 +3035,7 @@ scan_troff(char *c, int san, char **result) { /* san : stop at newline */ if (h[-1] == '\n' && still_dd && isalnum(*h)) { /* sometimes a .HP request is not followed by a .br request */ FLUSHIBP; - out_html("

    "); + out_html("
    "); curpos=0; still_dd=0; } @@ -3074,13 +3074,13 @@ scan_troff(char *c, int san, char **result) { /* san : stop at newline */ case '\n': if (h[-1] == '\n' && fillout) { intbuff[ibp++]='<'; - intbuff[ibp++]='P'; + intbuff[ibp++]='p'; intbuff[ibp++]='>'; } if (contained_tab && fillout) { intbuff[ibp++]='<'; - intbuff[ibp++]='B'; - intbuff[ibp++]='R'; + intbuff[ibp++]='b'; + intbuff[ibp++]='r'; intbuff[ibp++]='>'; } contained_tab=0; @@ -3106,12 +3106,12 @@ scan_troff(char *c, int san, char **result) { /* san : stop at newline */ curpos++; } } else { - out_html(""); + out_html(""); while (curpos < tabstops[curtab]) { out_html(" "); curpos++; } - out_html(""); + out_html(""); } } } @@ -3120,7 +3120,7 @@ scan_troff(char *c, int san, char **result) { /* san : stop at newline */ if (*h == ' ' && (h[-1] == '\n' || usenbsp)) { FLUSHIBP; if (!usenbsp && fillout) { - out_html("
    "); + out_html("
    "); curpos=0; } usenbsp=fillout; @@ -3192,12 +3192,12 @@ static void error_page(char *s, char *t, ...) { va_list p; - printf("%s\n" - "\n

    %s

    \n", s, s); + printf("%s\n" + "\n

    %s

    \n", s, s); va_start(p, t); vfprintf(stdout, t, p); va_end(p); - printf("\n"); + printf("\n"); abort(); } @@ -3394,20 +3394,20 @@ main(int argc, char **argv) { out_html(change_to_size(0)); if (!fillout) { fillout=1; - out_html(""); + out_html(""); } out_html(NEWLINE); if (output_possible) { /*   for mosaic users */ - printf("
    \n 

    Index

    \n
    \n"); + printf("
    \n 

    Index

    \n
    \n"); if (manidx) { manidx[mip]=0; printf("%s", manidx); } - while (subs--) printf("
    \n"); - printf("
    \n"); + while (subs--) printf("\n"); + printf("\n"); print_sig(); - printf("\n\n"); + printf("\n\n"); } else { if (!filename) filename = fname; @@ -3416,7 +3416,7 @@ main(int argc, char **argv) { "The requested file %s is not a valid (unformatted) " "man page.\nIf the file is a formatted manpage, " "you could try to load the\n" - "plain file.\n", + "plain file.\n", filename, filename); else error_page("Invalid Manpage", -- cgit v1.2.3