is_atxheader • returns whether the line is a hash-prefixed header */
| 1451 | |
| 1452 | /* is_atxheader • returns whether the line is a hash-prefixed header */ |
| 1453 | static int |
| 1454 | is_atxheader(hoedown_document *doc, uint8_t *data, size_t size) |
| 1455 | { |
| 1456 | if (data[0] != '#') |
| 1457 | return 0; |
| 1458 | |
| 1459 | if (doc->ext_flags & HOEDOWN_EXT_SPACE_HEADERS) { |
| 1460 | size_t level = 0; |
| 1461 | |
| 1462 | while (level < size && level < 6 && data[level] == '#') |
| 1463 | level++; |
| 1464 | |
| 1465 | if (level < size && data[level] != ' ') |
| 1466 | return 0; |
| 1467 | } |
| 1468 | |
| 1469 | return 1; |
| 1470 | } |
| 1471 | |
| 1472 | /* is_headerline • returns whether the line is a setext-style hdr underline */ |
| 1473 | static int |
no outgoing calls
no test coverage detected