The href of an ` ` at s[0, n): pushed as a URL. */
| 371 | |
| 372 | /* The href of an `<a href="...">` at s[0, n): pushed as a URL. */ |
| 373 | static void jv_java_href(jv_doc_t *d, const char *s, size_t n, uint32_t line) { |
| 374 | static const char key[] = "href"; |
| 375 | for (size_t i = 0; i + sizeof(key) <= n && s[i] != '>'; i++) { |
| 376 | if (memcmp(s + i, key, sizeof(key) - SKIP_ONE) != 0) { |
| 377 | continue; |
| 378 | } |
| 379 | size_t j = i + sizeof(key) - SKIP_ONE; |
| 380 | while (j < n && (s[j] == ' ' || s[j] == '\t')) { |
| 381 | j++; |
| 382 | } |
| 383 | if (j >= n || s[j] != '=') { |
| 384 | continue; |
| 385 | } |
| 386 | j++; |
| 387 | while (j < n && (s[j] == ' ' || s[j] == '\t')) { |
| 388 | j++; |
| 389 | } |
| 390 | if (j >= n || (s[j] != '"' && s[j] != '\'')) { |
| 391 | return; |
| 392 | } |
| 393 | char quote = s[j]; |
| 394 | size_t v = j + SKIP_ONE; |
| 395 | size_t e = v; |
| 396 | while (e < n && s[e] != quote) { |
| 397 | e++; |
| 398 | } |
| 399 | if (e < n && e > v) { |
| 400 | jv_push(d, s + v, e - v, line, CBM_DOCLINK_HREF); |
| 401 | } |
| 402 | return; |
| 403 | } |
| 404 | } |
| 405 | |
| 406 | /* `@see ...` / `@throws ...`: the rest of the tag's line starts at `i`. */ |
| 407 | static void jv_java_block_tag(jv_doc_t *d, size_t i, uint32_t line, bool see) { |
no test coverage detected