From 00fc6c0ae5c7af1634c2d619f353175e4831ae1b Mon Sep 17 00:00:00 2001 From: Alex Baines Date: Fri, 21 May 2021 00:50:07 +0100 Subject: [PATCH] hmmlib2 2.0.5: post-text marker fixes they don't have parameters, and there can be multiple --- hmmlib2/hmmlib.h | 14 +++++++++++--- hmmlib2/utils/obbg032_1.hmml | 2 +- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/hmmlib2/hmmlib.h b/hmmlib2/hmmlib.h index ac093d5..9b77b21 100644 --- a/hmmlib2/hmmlib.h +++ b/hmmlib2/hmmlib.h @@ -664,8 +664,16 @@ static void _hmml_parse_annotations(struct _hmml_parser* p) int text_len = _hmml_parse_text(p, &anno); if(p->cursor[0] == '[' && p->cursor[1] == ':') { - HMML_Marker m = _hmml_parse_marker(p); - _hmml_persist_array(p, &anno.markers, &anno.marker_count, m); + ++p->cursor; + do { + HMML_Marker m = _hmml_parse_marker(p); + _hmml_persist_array(p, &anno.markers, &anno.marker_count, m); + _hmml_skip_ws(p); + if(*p->cursor != ':' && *p->cursor != ']') { + _hmml_err(p, "Unterminated post-text category node"); + } + } while(*p->cursor == ':'); + ++p->cursor; } if(p->cursor[0] == '[' && p->cursor[1] == 'q') { @@ -793,7 +801,7 @@ void hmml_free(HMML_Output* out) } const struct HMML_Version hmml_version = { - 2, 0, 4 + 2, 0, 5 }; #undef HSTX diff --git a/hmmlib2/utils/obbg032_1.hmml b/hmmlib2/utils/obbg032_1.hmml index fe1e27e..c3ff458 100644 --- a/hmmlib2/utils/obbg032_1.hmml +++ b/hmmlib2/utils/obbg032_1.hmml @@ -1,6 +1,6 @@ [video member=nothings stream_platform=twitch stream_username=nothings2 project=obbg title="Open Block Building Game Development #32 (1/2)" vod_platform=youtube id=Vm-0ZUVMHHc annotator=Miblo] [2:01][Recap and update the TODO list] -[10:08][Consult the example YouTube description file and the longest .hmml file] +[10:08][Consult the example YouTube description file and the longest .hmml file][:test1 :test2 :abcd] [38:58][Continue implementing parse_tag()][:parsing] [41:40][@miblo][Ohhh, right. Yeah, the \[video\] and \[/video\] tags are the only ones that have that open-close format. All the other tags are "single" tags] [41:51][Continue writing parse_tag() anyway][:parsing]