now using short tags like <b> and CSS instead of <font color=...>;

this chops the output size in half
This commit is contained in:
erik%vanderpoel.org 2005-02-05 16:30:04 +00:00
Родитель ced4e939c7
Коммит 4e3e26bee1
2 изменённых файлов: 31 добавлений и 29 удалений

Просмотреть файл

@ -76,12 +76,13 @@ cgiviewHTMLAttributeValue(App *app, HTML *html, Buf *buf)
fprintf(view->out, "&referer=%s\">", referer);
free(referer);
urlFree(url);
}
viewHTMLAttributeValue(app, buf);
if (html->currentAttributeIsURL)
{
viewHTMLText(app, buf);
fprintf(view->out, "</a>");
}
else
{
viewHTMLAttributeValue(app, buf);
}
}
static void
@ -157,12 +158,13 @@ cgiviewHTTPResponseHeaderValue(App *app, Buf *buf, unsigned char *url)
urlstring = escapeHTML(url);
fprintf(view->out, "<a href=\"%s%s\">", me, urlstring);
free(urlstring);
}
viewHTTPHeaderValue(app, buf);
if (url)
{
viewHTTP(app, buf);
fprintf(view->out, "</a>");
}
else
{
viewHTTPHeaderValue(app, buf);
}
}
static HTTPNameValue *
@ -383,9 +385,9 @@ main(int argc, char *argv[])
}
if (url && (*url))
{
fprintf(view->out,
"<html><head><title>View %s</title></head><body>\n",
url);
fprintf(view->out, "<html><head><title>View %s</title>", url);
fprintf(view->out, "<link rel=stylesheet href=view.css>");
fprintf(view->out, "</head><body>\n");
viewReport(app, "input url:");
viewReport(app, (char *) url);
viewReportHTML(app, "<hr>");

Просмотреть файл

@ -24,9 +24,9 @@
#include "all.h"
#define CONTROL_START "<font color=#FF0000>"
#define CONTROL_START "<s>"
#define CONTROL(str) CONTROL_START str CONTROL_END
#define CONTROL_END "</font>"
#define CONTROL_END "</s>"
#define NL "\n"
static int verbose = 0;
@ -156,49 +156,49 @@ print(View *view, Buf *b)
void
viewHTML(App *app, Buf *buf)
{
fprintf(app->view.out, "<font color=#009900>");
fprintf(app->view.out, "<em>");
print(&app->view, buf);
fprintf(app->view.out, "</font>");
fprintf(app->view.out, "</em>");
}
void
viewHTMLAttributeName(App *app, Buf *buf)
{
fprintf(app->view.out, "<font color=#FF6600>");
fprintf(app->view.out, "<u>");
print(&app->view, buf);
fprintf(app->view.out, "</font>");
fprintf(app->view.out, "</u>");
}
void
viewHTMLAttributeValue(App *app, Buf *buf)
{
fprintf(app->view.out, "<font color=#3333FF>");
fprintf(app->view.out, "<i>");
print(&app->view, buf);
fprintf(app->view.out, "</font>");
fprintf(app->view.out, "</i>");
}
void
viewHTMLDeclaration(App *app, Buf *buf)
{
fprintf(app->view.out, "<font color=#999933><i>");
fprintf(app->view.out, "<tt>");
print(&app->view, buf);
fprintf(app->view.out, "</i></font>");
fprintf(app->view.out, "</tt>");
}
void
viewHTMLProcessingInstruction(App *app, Buf *buf)
{
fprintf(app->view.out, "<font color=#660000><i>");
fprintf(app->view.out, "<var>");
print(&app->view, buf);
fprintf(app->view.out, "</i></font>");
fprintf(app->view.out, "</var>");
}
void
viewHTMLTag(App *app, Buf *buf)
{
fprintf(app->view.out, "<font color=#CC33CC>");
fprintf(app->view.out, "<b>");
print(&app->view, buf);
fprintf(app->view.out, "</font>");
fprintf(app->view.out, "</b>");
}
void
@ -216,17 +216,17 @@ viewHTTP(App *app, Buf *buf)
void
viewHTTPHeaderName(App *app, Buf *buf)
{
fprintf(app->view.out, "<font color=#FF6600>");
fprintf(app->view.out, "<u>");
print(&app->view, buf);
fprintf(app->view.out, "</font>");
fprintf(app->view.out, "</u>");
}
void
viewHTTPHeaderValue(App *app, Buf *buf)
{
fprintf(app->view.out, "<font color=#3333FF>");
fprintf(app->view.out, "<i>");
print(&app->view, buf);
fprintf(app->view.out, "</font>");
fprintf(app->view.out, "</i>");
}
void