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

Function parse_inline

libraries/hoedown/src/document.c:459–495  ·  view source on GitHub ↗

parse_inline • parses inline markdown elements */

Source from the content-addressed store, hash-verified

457
458/* parse_inline • parses inline markdown elements */
459static void
460parse_inline(hoedown_buffer *ob, hoedown_document *doc, uint8_t *data, size_t size)
461{
462 size_t i = 0, end = 0, consumed = 0;
463 hoedown_buffer work = { 0, 0, 0, 0, NULL, NULL, NULL };
464 uint8_t *active_char = doc->active_char;
465
466 if (doc->work_bufs[BUFFER_SPAN].size +
467 doc->work_bufs[BUFFER_BLOCK].size > doc->max_nesting)
468 return;
469
470 while (i < size) {
471 /* copying inactive chars into the output */
472 while (end < size && active_char[data[end]] == 0)
473 end++;
474
475 if (doc->md.normal_text) {
476 work.data = data + i;
477 work.size = end - i;
478 doc->md.normal_text(ob, &work, &doc->data);
479 }
480 else
481 hoedown_buffer_put(ob, data + i, end - i);
482
483 if (end >= size) break;
484 i = end;
485
486 end = markdown_char_ptrs[ (int)active_char[data[end]] ](ob, doc, data + i, i - consumed, size - i);
487 if (!end) /* no action from the callback */
488 end = i + 1;
489 else {
490 i += end;
491 end = i;
492 consumed = i;
493 }
494 }
495}
496
497/* is_escaped • returns whether special char at data[loc] is escaped by '\\' */
498static int

Callers 11

parse_emph1Function · 0.85
parse_emph2Function · 0.85
parse_emph3Function · 0.85
char_quoteFunction · 0.85
char_linkFunction · 0.85
char_superscriptFunction · 0.85
parse_paragraphFunction · 0.85
parse_listitemFunction · 0.85
parse_atxheaderFunction · 0.85
parse_table_rowFunction · 0.85

Calls 1

hoedown_buffer_putFunction · 0.85

Tested by

no test coverage detected