text-item: Simplify text_item further to just hold a pivot_value.
[pspp] / src / output / html.c
index f14386335efe63deaa16a69e17f2da76467ce07d..0be011d12876acbac0f55c255aece5c8cb8d9227 100644 (file)
@@ -292,7 +292,7 @@ html_submit (struct output_driver *driver,
   else if (is_text_item (output_item))
     {
       struct text_item *text_item = to_text_item (output_item);
-      const char *s = text_item_get_text (text_item);
+      char *s = text_item_get_plain_text (text_item);
 
       switch (text_item_get_type (text_item))
         {
@@ -319,6 +319,8 @@ html_submit (struct output_driver *driver,
           fprintf (html->file, "</p>\n");
           break;
         }
+
+      free (s);
     }
   else if (is_message_item (output_item))
     {
@@ -586,16 +588,20 @@ html_put_table_cell (struct html_driver *html, const struct pivot_table *pt,
   if (cell->value->n_footnotes > 0)
     {
       fputs ("<sup>", html->file);
+      size_t n_footnotes = 0;
       for (size_t i = 0; i < cell->value->n_footnotes; i++)
         {
-          if (i > 0)
-            putc (',', html->file);
+          const struct pivot_footnote *f
+            = pt->footnotes[cell->value->footnote_indexes[i]];
+          if (f->show)
+            {
+              if (n_footnotes++ > 0)
+                putc (',', html->file);
 
-          size_t idx = cell->value->footnote_indexes[i];
-          const struct pivot_footnote *f = pt->footnotes[idx];
-          char *marker = pivot_value_to_string (f->marker, pt);
-          escape_string (html->file, marker, " ", "<br>");
-          free (marker);
+              char *marker = pivot_footnote_marker_string (f, pt);
+              escape_string (html->file, marker, " ", "<br>");
+              free (marker);
+            }
         }
       fputs ("</sup>", html->file);
     }