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

Function char_entity

libraries/hoedown/src/document.c:939–964  ·  view source on GitHub ↗

char_entity • '&' escaped when it doesn't belong to an entity */ valid entities are assumed to be anything matching &#?[A-Za-z0-9]+; */

Source from the content-addressed store, hash-verified

937/* char_entity • '&' escaped when it doesn't belong to an entity */
938/* valid entities are assumed to be anything matching &#?[A-Za-z0-9]+; */
939static size_t
940char_entity(hoedown_buffer *ob, hoedown_document *doc, uint8_t *data, size_t offset, size_t size)
941{
942 size_t end = 1;
943 hoedown_buffer work = { 0, 0, 0, 0, NULL, NULL, NULL };
944
945 if (end < size && data[end] == '#')
946 end++;
947
948 while (end < size && isalnum(data[end]))
949 end++;
950
951 if (end < size && data[end] == ';')
952 end++; /* real entity */
953 else
954 return 0; /* lone '&' */
955
956 if (doc->md.entity) {
957 work.data = data;
958 work.size = end;
959 doc->md.entity(ob, &work, &doc->data);
960 }
961 else hoedown_buffer_put(ob, data, end);
962
963 return end;
964}
965
966/* char_langle_tag • '<' when tags or autolinks are allowed */
967static size_t

Callers

nothing calls this directly

Calls 1

hoedown_buffer_putFunction · 0.85

Tested by

no test coverage detected