MCPcopy Create free account
hub / github.com/PolyMC/PolyMC / htmlblock_find_end_strict

Function htmlblock_find_end_strict

libraries/hoedown/src/document.c:2085–2107  ·  view source on GitHub ↗

htmlblock_find_end_strict • try to find end of HTML block in strict mode */ (it must be an unindented line, and have a blank line afterwads) */ returns the length on match, 0 otherwise */

Source from the content-addressed store, hash-verified

2083/* (it must be an unindented line, and have a blank line afterwads) */
2084/* returns the length on match, 0 otherwise */
2085static size_t
2086htmlblock_find_end_strict(
2087 const char *tag,
2088 size_t tag_len,
2089 hoedown_document *doc,
2090 uint8_t *data,
2091 size_t size)
2092{
2093 size_t i = 0, mark;
2094
2095 while (1) {
2096 mark = i;
2097 while (i < size && data[i] != '\n') i++;
2098 if (i < size) i++;
2099 if (i == mark) return 0;
2100
2101 if (data[mark] == ' ' && mark > 0) continue;
2102 mark += htmlblock_find_end(tag, tag_len, doc, data + mark, i - mark);
2103 if (mark == i && (is_empty(data + i, size - i) || i >= size)) break;
2104 }
2105
2106 return i;
2107}
2108
2109/* parse_htmlblock • parsing of inline HTML block */
2110static size_t

Callers 1

parse_htmlblockFunction · 0.85

Calls 2

htmlblock_find_endFunction · 0.85
is_emptyFunction · 0.85

Tested by

no test coverage detected