aboutsummaryrefslogtreecommitdiffstats
path: root/src/blogc/template-parser.c
diff options
context:
space:
mode:
authorRafael G. Martins <rafael@rafaelmartins.eng.br>2020-05-16 03:33:22 +0200
committerRafael G. Martins <rafael@rafaelmartins.eng.br>2020-05-16 03:33:22 +0200
commit8e12ae57ebe87d25c2c34ec304047fec3013da85 (patch)
treefc7f974219f6d60d8e866a540da45f69e696546b /src/blogc/template-parser.c
parentf5db671822b7b6dc74166c1c9e34a900c7f0d0cb (diff)
downloadblogc-8e12ae57ebe87d25c2c34ec304047fec3013da85.tar.gz
blogc-8e12ae57ebe87d25c2c34ec304047fec3013da85.tar.bz2
blogc-8e12ae57ebe87d25c2c34ec304047fec3013da85.zip
blogc: added listing_empty template block
Diffstat (limited to 'src/blogc/template-parser.c')
-rw-r--r--src/blogc/template-parser.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/blogc/template-parser.c b/src/blogc/template-parser.c
index 0b4eb55..d3e9daf 100644
--- a/src/blogc/template-parser.c
+++ b/src/blogc/template-parser.c
@@ -380,6 +380,14 @@ blogc_template_parse(const char *src, size_t src_len, bc_error_t **err)
break;
}
else if ((current - start == 13) &&
+ (0 == strncmp("listing_empty", src + start, 13)))
+ {
+ block_open = true;
+ end = current;
+ state = TEMPLATE_BLOCK_END_WHITESPACE_CLEANER;
+ break;
+ }
+ else if ((current - start == 13) &&
(0 == strncmp("listing_entry", src + start, 13)))
{
block_open = true;
@@ -391,7 +399,7 @@ blogc_template_parse(const char *src, size_t src_len, bc_error_t **err)
*err = bc_error_parser(BLOGC_ERROR_TEMPLATE_PARSER, src,
src_len, current,
"Invalid block type. Allowed types are: 'entry', 'listing', "
- "'listing_once' and 'listing_entry'.");
+ "'listing_once', 'listing_empty' and 'listing_entry'.");
break;
case TEMPLATE_BLOCK_IF_START: