driver: Do not accumulate marked-up text.
authorBen Pfaff <blp@cs.stanford.edu>
Sat, 19 Oct 2019 05:41:25 +0000 (05:41 +0000)
committerBen Pfaff <blp@cs.stanford.edu>
Sun, 29 Dec 2019 05:28:10 +0000 (05:28 +0000)
The output engine accumulates lines of text into blocks and outputs them
all at once.  This doesn't currently work for text with markup, so this
commit disables it.  It might be better to make it work, hence this
commit also adds an XXX marker.

src/output/driver.c

index 82556c81d0c41d858f816eb41939be613bfc8f51..8e856222dc771ea20dc9157b0ad308fafface20c 100644 (file)
@@ -194,7 +194,11 @@ defer_text (struct output_engine *e, struct output_item *item)
   if (!is_text_item (item))
     return false;
 
-  enum text_item_type type = text_item_get_type (to_text_item (item));
+  struct text_item *text_item = to_text_item (item);
+  if (text_item->markup)        /* XXX */
+    return false;
+
+  enum text_item_type type = text_item_get_type (text_item);
   if (type != TEXT_ITEM_SYNTAX && type != TEXT_ITEM_LOG)
     return false;
 
@@ -206,7 +210,7 @@ defer_text (struct output_engine *e, struct output_item *item)
   if (!ds_is_empty (&e->deferred_text))
     ds_put_byte (&e->deferred_text, '\n');
 
-  const char *text = text_item_get_text (to_text_item (item));
+  const char *text = text_item_get_text (text_item);
   ds_put_cstr (&e->deferred_text, text);
   output_item_unref (item);