diff options
author | Thomas White <taw@bitwiz.org.uk> | 2013-08-25 17:28:57 +0200 |
---|---|---|
committer | Thomas White <taw@bitwiz.org.uk> | 2013-08-25 17:28:57 +0200 |
commit | ba5c48c7729d92216df12166c643ecbd4470808e (patch) | |
tree | 9fbbfa473db5854cfc17bc6781de60d7ba294e06 | |
parent | 21c2072f7547df92512baddceb476526e50df36a (diff) |
Allow quotes in style list in template
-rw-r--r-- | src/stylesheet.c | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/src/stylesheet.c b/src/stylesheet.c index 515d656..5372d52 100644 --- a/src/stylesheet.c +++ b/src/stylesheet.c @@ -188,18 +188,27 @@ static int read_template(struct slide_template *t, StyleSheet *ss, for ( i=0; i<node->n_children; i++ ) { - struct style *sty; + char *sn; if ( strncmp(node->children[i]->key, "sty", 3) != 0 ) { continue; } - sty = lookup_style(ss, node->children[i]->value); - if ( sty == NULL ) { - fprintf(stderr, "Couldn't find style '%s'\n", - node->children[i]->value); - } else { - add_to_template(t, sty); + /* This looks a bit weird, but it's done so that the contents + * can go through the same validation as other fields */ + if ( !get_field_s(node, node->children[i]->key, &sn) ) { + + struct style *sty; + + sty = lookup_style(ss, sn); + if ( sty == NULL ) { + fprintf(stderr, "Couldn't find style '%s'\n", + sn); + } else { + add_to_template(t, sty); + } + + free(sn); } } |