aboutsummaryrefslogtreecommitdiffstats
path: root/src/blogc/template-parser.c
diff options
context:
space:
mode:
authorRafael G. Martins <rafael@rafaelmartins.eng.br>2019-04-02 22:57:33 +0200
committerRafael G. Martins <rafael@rafaelmartins.eng.br>2019-04-02 22:57:33 +0200
commitadc3e6d77117d095e485ec64a93f1b64ffbf2cea (patch)
tree684980dc6772818afd71cfddd14cc583285ad17e /src/blogc/template-parser.c
parent1101d2fa0eb14baab50cc5c6cf63078930c06290 (diff)
downloadblogc-adc3e6d77117d095e485ec64a93f1b64ffbf2cea.tar.gz
blogc-adc3e6d77117d095e485ec64a93f1b64ffbf2cea.tar.bz2
blogc-adc3e6d77117d095e485ec64a93f1b64ffbf2cea.zip
blogc: added `-e` cli option and `listing_entry` template block
Diffstat (limited to 'src/blogc/template-parser.c')
-rw-r--r--src/blogc/template-parser.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/blogc/template-parser.c b/src/blogc/template-parser.c
index a53f1aa..0b4eb55 100644
--- a/src/blogc/template-parser.c
+++ b/src/blogc/template-parser.c
@@ -379,11 +379,19 @@ blogc_template_parse(const char *src, size_t src_len, bc_error_t **err)
state = TEMPLATE_BLOCK_END_WHITESPACE_CLEANER;
break;
}
+ else if ((current - start == 13) &&
+ (0 == strncmp("listing_entry", src + start, 13)))
+ {
+ block_open = true;
+ end = current;
+ state = TEMPLATE_BLOCK_END_WHITESPACE_CLEANER;
+ break;
+ }
}
*err = bc_error_parser(BLOGC_ERROR_TEMPLATE_PARSER, src,
src_len, current,
- "Invalid block type. Allowed types are: 'entry', 'listing' "
- "and 'listing_once'.");
+ "Invalid block type. Allowed types are: 'entry', 'listing', "
+ "'listing_once' and 'listing_entry'.");
break;
case TEMPLATE_BLOCK_IF_START: