aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2019-10-01 20:20:50 +0200
committerThomas White <taw@physics.org>2019-10-05 17:03:43 +0200
commit6d26ea13466c1d5399b0330bbde1b497edc63f24 (patch)
treee5ada07d214c989a8033c5a741753016f8f1bb3b
parenta543c0f7b2855d701d0e049773780dc43e0ea8e0 (diff)
write_item: Use write_para
-rw-r--r--libstorycode/storycode.c17
1 files changed, 3 insertions, 14 deletions
diff --git a/libstorycode/storycode.c b/libstorycode/storycode.c
index 7b8b464..18e5270 100644
--- a/libstorycode/storycode.c
+++ b/libstorycode/storycode.c
@@ -254,37 +254,26 @@ static int write_slide(GOutputStream *fh, Slide *s)
static int write_item(GOutputStream *fh, struct narrative_item *item)
{
- int i;
-
switch ( item->type ) {
case NARRATIVE_ITEM_TEXT:
/* FIXME: separate alignment */
if ( write_string(fh, ": ") ) return 1;
- for ( i=0; i<item->n_runs; i++ ) {
- /* FIXME: Run markers (e.g. '*') */
- if ( write_string(fh, item->runs[i].text) ) return 1;
- }
+ write_para(fh, item->runs, item->n_runs);
if ( write_string(fh, "\n") ) return 1;
break;
case NARRATIVE_ITEM_PRESTITLE:
/* FIXME: separate alignment */
if ( write_string(fh, "PRESTITLE: ") ) return 1;
- for ( i=0; i<item->n_runs; i++ ) {
- /* FIXME: Run markers (e.g. '*') */
- if ( write_string(fh, item->runs[i].text) ) return 1;
- }
+ write_para(fh, item->runs, item->n_runs);
if ( write_string(fh, "\n") ) return 1;
break;
case NARRATIVE_ITEM_BP:
/* FIXME: separate alignment */
if ( write_string(fh, "BP: ") ) return 1;
- for ( i=0; i<item->n_runs; i++ ) {
- /* FIXME: Run markers (e.g. '*') */
- if ( write_string(fh, item->runs[i].text) ) return 1;
- }
+ write_para(fh, item->runs, item->n_runs);
if ( write_string(fh, "\n") ) return 1;
break;