HTML-escape into the buffer — every graph-derived string passes here. */
| 61 | |
| 62 | /* HTML-escape into the buffer — every graph-derived string passes here. */ |
| 63 | static void hd_esc(hd_buf_t *b, const char *s) { |
| 64 | if (!s) |
| 65 | return; |
| 66 | for (const char *c = s; *c; c++) { |
| 67 | switch (*c) { |
| 68 | case '&': |
| 69 | hd_put(b, "&"); |
| 70 | break; |
| 71 | case '<': |
| 72 | hd_put(b, "<"); |
| 73 | break; |
| 74 | case '>': |
| 75 | hd_put(b, ">"); |
| 76 | break; |
| 77 | case '"': |
| 78 | hd_put(b, """); |
| 79 | break; |
| 80 | default: { |
| 81 | char one[2] = {*c, 0}; |
| 82 | hd_put(b, one); |
| 83 | } |
| 84 | } |
| 85 | } |
| 86 | } |
| 87 | |
| 88 | static const char *hd_cohesion_word(double cohesion) { |
| 89 | if (cohesion >= 0.7) |
no test coverage detected