char_entity • '&' escaped when it doesn't belong to an entity */ valid entities are assumed to be anything matching &#?[A-Za-z0-9]+; */
| 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]+; */ |
| 939 | static size_t |
| 940 | char_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 */ |
| 967 | static size_t |
nothing calls this directly
no test coverage detected