hmmlib2: allow marker as first thing in text node
This commit is contained in:
parent
c911e393d5
commit
3f47e62a7e
|
@ -586,8 +586,9 @@ static size_t _hmml_parse_text(struct _hmml_parser* p, HMML_Annotation* anno)
|
|||
|
||||
// it is a @ ~ or : marker without parameters
|
||||
else {
|
||||
// if next char is a space, or prev char is not a space, then it can't be a marker
|
||||
if(strchr(" \t\r\n", p->cursor[1]) || !strchr(" \t\r\n", p->cursor[-1])) {
|
||||
// if next char is a space, or prev char is not a space*, then it can't be a marker
|
||||
// * unless it's the first char
|
||||
if(strchr(" \t\r\n", p->cursor[1]) || !(out == text_mem || strchr(" \t\r\n", p->cursor[-1]))) {
|
||||
*out++ = c;
|
||||
++p->cursor;
|
||||
} else {
|
||||
|
@ -796,7 +797,7 @@ void hmml_free(HMML_Output* out)
|
|||
}
|
||||
|
||||
const struct HMML_Version hmml_version = {
|
||||
2, 0, 2
|
||||
2, 0, 3
|
||||
};
|
||||
|
||||
#undef HSTX
|
||||
|
|
Loading…
Reference in New Issue