diff options
author | Steffen Kieß <kiess@ki4.de> | 2020-06-24 17:03:55 +0200 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2020-06-24 09:59:43 -0700 |
commit | c0b9c3125abab6081e0b54140900718c9b7a18d3 (patch) | |
tree | d9617d9946347f03c89bcebb4ff17fbe55a49766 /src/html.c | |
parent | 54b377278187f02621a60b3585de4ec02399234a (diff) |
Fix handling of empty strings when creating XML/HTML output.
Diffstat (limited to 'src/html.c')
-rw-r--r-- | src/html.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -276,8 +276,8 @@ static int S_render_node(cmark_node *node, cmark_event_type ev_type, case CMARK_NODE_LINK: if (entering) { cmark_strbuf_puts(html, "<a href=\""); - if ((options & CMARK_OPT_UNSAFE) || - !(_scan_dangerous_url(node->as.link.url))) { + if (node->as.link.url && ((options & CMARK_OPT_UNSAFE) || + !(_scan_dangerous_url(node->as.link.url)))) { houdini_escape_href(html, node->as.link.url, strlen((char *)node->as.link.url)); } @@ -295,8 +295,8 @@ static int S_render_node(cmark_node *node, cmark_event_type ev_type, case CMARK_NODE_IMAGE: if (entering) { cmark_strbuf_puts(html, "<img src=\""); - if ((options & CMARK_OPT_UNSAFE) || - !(_scan_dangerous_url(node->as.link.url))) { + if (node->as.link.url && ((options & CMARK_OPT_UNSAFE) || + !(_scan_dangerous_url(node->as.link.url)))) { houdini_escape_href(html, node->as.link.url, strlen((char *)node->as.link.url)); } |