#ifndef HTML_H
#define HTML_H

#define HTML_MAX_LINKS 128
#define HTML_URL_SIZE  256

struct html_link {
    int line;                       /* line number in rendered output (0-based) */
    int col;                        /* column where link text starts */
    int len;                        /* length of link text in chars */
    char url[HTML_URL_SIZE];        /* resolved URL */
};

/* Full HTML parser — renders clean text to html_buf[].
 * Skips: SVG, script, style, head, noscript, template, comments, DOCTYPE.
 * Supports: block/inline tags, lists, tables, pre/code, headings, links,
 *           images (alt text), entities, whitespace collapsing. */
void html_parse_and_render(const char *html);

/* Link table — populated by html_parse_and_render */
extern struct html_link html_links[];
extern int html_link_count;
extern char html_base_url[HTML_URL_SIZE];

#endif
