MCPcopy Create free account
hub / github.com/MultiMC/Launcher / char_superscript

Function char_superscript

libraries/hoedown/src/document.c:1291–1325  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1289}
1290
1291static size_t
1292char_superscript(hoedown_buffer *ob, hoedown_document *doc, uint8_t *data, size_t offset, size_t size)
1293{
1294 size_t sup_start, sup_len;
1295 hoedown_buffer *sup;
1296
1297 if (!doc->md.superscript)
1298 return 0;
1299
1300 if (size < 2)
1301 return 0;
1302
1303 if (data[1] == '(') {
1304 sup_start = 2;
1305 sup_len = find_emph_char(data + 2, size - 2, ')') + 2;
1306
1307 if (sup_len == size)
1308 return 0;
1309 } else {
1310 sup_start = sup_len = 1;
1311
1312 while (sup_len < size && !_isspace(data[sup_len]))
1313 sup_len++;
1314 }
1315
1316 if (sup_len - sup_start == 0)
1317 return (sup_start == 2) ? 3 : 0;
1318
1319 sup = newbuf(doc, BUFFER_SPAN);
1320 parse_inline(sup, doc, data + sup_start, sup_len - sup_start);
1321 doc->md.superscript(ob, sup, &doc->data);
1322 popbuf(doc, BUFFER_SPAN);
1323
1324 return (sup_start == 2) ? sup_len + 1 : sup_len;
1325}
1326
1327static size_t
1328char_math(hoedown_buffer *ob, hoedown_document *doc, uint8_t *data, size_t offset, size_t size)

Callers

nothing calls this directly

Calls 5

find_emph_charFunction · 0.85
_isspaceFunction · 0.85
newbufFunction · 0.85
parse_inlineFunction · 0.85
popbufFunction · 0.85

Tested by

no test coverage detected