version 1.95, 2010/01/30 08:42:20 |
version 1.98, 2010/04/08 07:05:38 |
Line 466 print_doctype(struct html *h) |
|
Line 466 print_doctype(struct html *h) |
|
{ |
{ |
const char *doctype; |
const char *doctype; |
const char *dtd; |
const char *dtd; |
|
const char *name; |
|
|
switch (h->type) { |
switch (h->type) { |
case (HTML_HTML_4_01_STRICT): |
case (HTML_HTML_4_01_STRICT): |
|
name = "HTML"; |
doctype = "-//W3C//DTD HTML 4.01//EN"; |
doctype = "-//W3C//DTD HTML 4.01//EN"; |
dtd = "http://www.w3.org/TR/html4/strict.dtd"; |
dtd = "http://www.w3.org/TR/html4/strict.dtd"; |
break; |
break; |
default: |
default: |
|
name = "html"; |
doctype = "-//W3C//DTD XHTML 1.0 Strict//EN"; |
doctype = "-//W3C//DTD XHTML 1.0 Strict//EN"; |
dtd = "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"; |
dtd = "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"; |
break; |
break; |
} |
} |
|
|
printf("<!DOCTYPE HTML PUBLIC \"%s\" \"%s\">\n", doctype, dtd); |
printf("<!DOCTYPE %s PUBLIC \"%s\" \"%s\">\n", |
|
name, doctype, dtd); |
} |
} |
|
|
|
|
Line 503 print_text(struct html *h, const char *p) |
|
Line 507 print_text(struct html *h, const char *p) |
|
case(')'): |
case(')'): |
/* FALLTHROUGH */ |
/* FALLTHROUGH */ |
case(']'): |
case(']'): |
/* FALLTHROUGH */ |
|
case('}'): |
|
if ( ! (HTML_IGNDELIM & h->flags)) |
if ( ! (HTML_IGNDELIM & h->flags)) |
h->flags |= HTML_NOSPACE; |
h->flags |= HTML_NOSPACE; |
break; |
break; |
Line 519 print_text(struct html *h, const char *p) |
|
Line 521 print_text(struct html *h, const char *p) |
|
if ( ! print_encode(h, p, 0)) |
if ( ! print_encode(h, p, 0)) |
h->flags &= ~HTML_NOSPACE; |
h->flags &= ~HTML_NOSPACE; |
|
|
|
/* |
|
* Note that we don't process the pipe: the parser sees it as |
|
* punctuation, but we don't in terms of typography. |
|
*/ |
if (*p && 0 == *(p + 1)) |
if (*p && 0 == *(p + 1)) |
switch (*p) { |
switch (*p) { |
case('('): |
case('('): |
/* FALLTHROUGH */ |
/* FALLTHROUGH */ |
case('['): |
case('['): |
/* FALLTHROUGH */ |
|
case('{'): |
|
h->flags |= HTML_NOSPACE; |
h->flags |= HTML_NOSPACE; |
break; |
break; |
default: |
default: |