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

Function parse_emph2

libraries/hoedown/src/document.c:644–673  ·  view source on GitHub ↗

parse_emph2 • parsing single emphase */

Source from the content-addressed store, hash-verified

642
643/* parse_emph2 • parsing single emphase */
644static size_t
645parse_emph2(hoedown_buffer *ob, hoedown_document *doc, uint8_t *data, size_t size, uint8_t c)
646{
647 size_t i = 0, len;
648 hoedown_buffer *work = 0;
649 int r;
650
651 while (i < size) {
652 len = find_emph_char(data + i, size - i, c);
653 if (!len) return 0;
654 i += len;
655
656 if (i + 1 < size && data[i] == c && data[i + 1] == c && i && !_isspace(data[i - 1])) {
657 work = newbuf(doc, BUFFER_SPAN);
658 parse_inline(work, doc, data, i);
659
660 if (c == '~')
661 r = doc->md.strikethrough(ob, work, &doc->data);
662 else if (c == '=')
663 r = doc->md.highlight(ob, work, &doc->data);
664 else
665 r = doc->md.double_emphasis(ob, work, &doc->data);
666
667 popbuf(doc, BUFFER_SPAN);
668 return r ? i + 2 : 0;
669 }
670 i++;
671 }
672 return 0;
673}
674
675/* parse_emph3 • parsing single emphase */
676/* finds the first closing tag, and delegates to the other emph */

Callers 2

parse_emph3Function · 0.85
char_emphasisFunction · 0.85

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