1
0
Fork 0

[link] Convert href for anchor to terminal codepage, usually utf-8. Refs #221

This commit is contained in:
Witold Filipczyk 2023-04-23 15:00:05 +02:00
parent e890b07584
commit 4a3fa85ee7
1 changed files with 8 additions and 4 deletions

View File

@ -54,13 +54,17 @@ html_a(struct html_context *html_context, char *a,
char *href;
href = get_url_val(a, "href", html_context->doc_cp);
if (href) {
char *target;
char *href_converted = convert_string(renderer_context.convert_table, href, strlen(href),
html_context->options->cp, CSM_NONE, NULL, NULL, NULL);
mem_free_set(&elformat.link,
join_urls(html_context->base_href,
trim_chars(href, ' ', 0)));
if (href_converted) {
mem_free_set(&elformat.link,
join_urls(html_context->base_href, trim_chars(href_converted, ' ', 0)));
mem_free(href_converted);
}
mem_free(href);
target = get_target(html_context->options, a);