Fix missing loop in content stream

This commit is contained in:
Wilson Lin 2018-07-05 20:56:49 +12:00
parent 5fc5ec88d8
commit 1c637e6a94
1 changed files with 20 additions and 18 deletions

View File

@ -10,27 +10,29 @@ void hbs_content(hbu_pipe_t pipe);
#include "./tag.c"
void hbs_content(hbu_pipe_t pipe) {
hb_eod_char_t c = hbu_pipe_peek_eoi(pipe);
while (1) {
hb_eod_char_t c = hbu_pipe_peek_eoi(pipe);
switch (c) {
case HB_EOD:
return;
case '<':
if (hbu_pipe_peek_offset(pipe, 2) == '/') {
// Callee is responsible for requiring close tag (or not, if root)
switch (c) {
case HB_EOD:
return;
case '<':
if (hbu_pipe_peek_offset(pipe, 2) == '/') {
// Callee is responsible for requiring close tag (or not, if root)
return;
}
hbs_tag(pipe);
break;
case '&':
// TODO
break;
default:
hbu_pipe_accept(pipe);
}
hbs_tag(pipe);
break;
case '&':
// TODO
break;
default:
hbu_pipe_accept(pipe);
}
}