version 1.99, 2010/04/12 19:45:39 |
version 1.100, 2010/05/25 12:37:20 |
|
|
#include <string.h> |
#include <string.h> |
#include <unistd.h> |
#include <unistd.h> |
|
|
|
#include "mandoc.h" |
#include "out.h" |
#include "out.h" |
#include "chars.h" |
#include "chars.h" |
#include "html.h" |
#include "html.h" |
Line 296 print_encode(struct html *h, const char *p, int norecu |
|
Line 297 print_encode(struct html *h, const char *p, int norecu |
|
int len, nospace; |
int len, nospace; |
const char *seq; |
const char *seq; |
enum roffdeco deco; |
enum roffdeco deco; |
|
static const char rejs[6] = { '\\', '<', '>', '&', ASCII_HYPH, '\0' }; |
|
|
nospace = 0; |
nospace = 0; |
|
|
for (; *p; p++) { |
for (; *p; p++) { |
sz = strcspn(p, "\\<>&"); |
sz = strcspn(p, rejs); |
|
|
fwrite(p, 1, sz, stdout); |
fwrite(p, 1, sz, stdout); |
p += /* LINTED */ |
p += /* LINTED */ |
Line 315 print_encode(struct html *h, const char *p, int norecu |
|
Line 317 print_encode(struct html *h, const char *p, int norecu |
|
} else if ('&' == *p) { |
} else if ('&' == *p) { |
printf("&"); |
printf("&"); |
continue; |
continue; |
|
} else if (ASCII_HYPH == *p) { |
|
/* |
|
* Note: "soft hyphens" aren't graphically |
|
* displayed when not breaking the text; we want |
|
* them to be displayed. |
|
*/ |
|
/*printf("­");*/ |
|
putchar('-'); |
|
continue; |
} else if ('\0' == *p) |
} else if ('\0' == *p) |
break; |
break; |
|
|
Line 443 print_gen_decls(struct html *h) |
|
Line 454 print_gen_decls(struct html *h) |
|
static void |
static void |
print_xmltype(struct html *h) |
print_xmltype(struct html *h) |
{ |
{ |
const char *decl; |
|
|
|
switch (h->type) { |
if (HTML_XHTML_1_0_STRICT == h->type) |
case (HTML_XHTML_1_0_STRICT): |
printf("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"); |
decl = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"; |
|
break; |
|
default: |
|
decl = NULL; |
|
break; |
|
} |
|
|
|
if (NULL == decl) |
|
return; |
|
|
|
printf("%s\n", decl); |
|
} |
} |
|
|
|
|