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

Function is_headerline

libraries/hoedown/src/document.c:1473–1491  ·  view source on GitHub ↗

is_headerline • returns whether the line is a setext-style hdr underline */

Source from the content-addressed store, hash-verified

1471
1472/* is_headerline • returns whether the line is a setext-style hdr underline */
1473static int
1474is_headerline(uint8_t *data, size_t size)
1475{
1476 size_t i = 0;
1477
1478 /* test of level 1 header */
1479 if (data[i] == '=') {
1480 for (i = 1; i < size && data[i] == '='; i++);
1481 while (i < size && data[i] == ' ') i++;
1482 return (i >= size || data[i] == '\n') ? 1 : 0; }
1483
1484 /* test of level 2 header */
1485 if (data[i] == '-') {
1486 for (i = 1; i < size && data[i] == '-'; i++);
1487 while (i < size && data[i] == ' ') i++;
1488 return (i >= size || data[i] == '\n') ? 2 : 0; }
1489
1490 return 0;
1491}
1492
1493static int
1494is_next_headerline(uint8_t *data, size_t size)

Callers 2

is_next_headerlineFunction · 0.85
parse_paragraphFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected