X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Foutput%2Fhtml.c;h=9e7f567a27274866efda6d67fddef2ca74082d3c;hb=b779cc2fe07d6e8e66aad413e4644e8e124c65ff;hp=c181ed2edad19eb646eb5e7e635cebf5cf0313d0;hpb=93ec42221da8b677420bf11435e0d24d0503601b;p=pspp diff --git a/src/output/html.c b/src/output/html.c index c181ed2eda..9e7f567a27 100644 --- a/src/output/html.c +++ b/src/output/html.c @@ -64,11 +64,10 @@ struct html_driver static const struct output_driver_class html_driver_class; -static void html_output_table (struct html_driver *, const struct table *, - const char *caption); +static void html_output_table (struct html_driver *, const struct table_item *); static void escape_string (FILE *file, const char *text, size_t length, - const char *space); + const char *space, const char *newline); static void print_title_tag (FILE *file, const char *name, const char *content); @@ -201,7 +200,7 @@ print_title_tag (FILE *file, const char *name, const char *content) if (content != NULL) { fprintf (file, "<%s>", name); - escape_string (file, content, strlen (content), " "); + escape_string (file, content, strlen (content), " ", " - "); fprintf (file, "%s>\n", name); } } @@ -236,8 +235,7 @@ html_submit (struct output_driver *driver, if (is_table_item (output_item)) { struct table_item *table_item = to_table_item (output_item); - html_output_table (html, table_item_get_table (table_item), - table_item_get_caption (table_item)); + html_output_table (html, table_item); } #ifdef HAVE_CAIRO else if (is_chart_item (output_item) && html->chart_file_name != NULL) @@ -276,7 +274,7 @@ html_submit (struct output_driver *driver, case TEXT_ITEM_COMMAND_OPEN: fprintf (html->file, "
"); - escape_string (html->file, s, strlen (s), " "); + escape_string (html->file, s, strlen (s), " ", "\n"); break; @@ -327,19 +325,23 @@ html_submit (struct output_driver *driver, } } -/* Write LENGTH characters in TEXT to file F, escaping characters - as necessary for HTML. Spaces are replaced by SPACE, which - should be " " or " ". */ +/* Write LENGTH characters in TEXT to file F, escaping characters as necessary + for HTML. Spaces are replaced by SPACE, which should be " " or " " + New-lines are replaced by NEWLINE, which might be "
"); fprintf (html->file, "