smu-noxz

[fork] simple markup - markdown like syntax
git clone git://git.noxz.tech/smu-noxz
Log | Files | Refs | LICENSE

commit befc902755909996e6a732950c6157638a29dfe0
parent 57b72a10e33dbfe501c6b12c47ee5dfd46ac9a02
Author: Chris Noxz <chris@noxz.tech>
Date:   Tue, 14 Apr 2020 09:19:18 +0200

Add base_url for hyperlinks

Diffstat:
Msmu.c | 18++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/smu.c b/smu.c @@ -271,12 +271,12 @@ dolink(const char *begin, const char *end, int newblock) { if(img) { fputs("<img src=\"", stdout); - if (strlen(base_url) - && *link != '/' - && (strstr(link, "://") == NULL - || strstr(link, "://") - link > linkend - link)) { - fputs(base_url, stdout); - } + if (strlen(base_url) + && *link != '/' + && (strstr(link, "://") == NULL + || strstr(link, "://") - link > linkend - link)) { + fputs(base_url, stdout); + } hprint(link, linkend); fputs("\" alt=\"", stdout); hprint(desc, descend); @@ -290,6 +290,12 @@ dolink(const char *begin, const char *end, int newblock) { } else { fputs("<a href=\"", stdout); + if (strlen(base_url) + && *link != '/' + && (strstr(link, "://") == NULL + || strstr(link, "://") - link > linkend - link)) { + fputs(base_url, stdout); + } hprint(link, linkend); fputs("\"", stdout); if(title && titleend) {