slweb

Једноставни генератор статичких веб страна
Дневник | Датотеке | Референце | ПРОЧИТАЈМЕ | ЛИЦЕНЦА

чување 05b9bc04bf26c2f2a5b170e8bbcb4ca62a034804
родитељ 3912753dabd534ab8457be13fa305820c780e9ed
Аутор: Страхиња Радић <contact@strahinja.org>
Датум:   Mon, 29 Mar 2021 09:42:32 +0200

Merge branch 'master' of git.sr.ht:~strahinja/slweb

Signed-off-by: Страхиња Радић <contact@strahinja.org>

Diffstat:
Mindex.html | 2+-
Mslweb.1.in | 5++---
Mslweb.c | 10+++++++---
измењених датотека: 3, додавања: 10(+), брисања: 7(-)

diff --git a/index.html b/index.html @@ -153,7 +153,7 @@ this program. If not, see &lt;<a href="https://www.gnu.org/licenses">https://www <div id="git-log"> Previous commit: -index.slw b81bf4d 2021-03-29 09:38:44 +0200 (Страхиња Радић) (HEAD -> master, origin/master, origin/HEAD) +index.slw d15fcda 2021-03-29 09:52:46 +0200 (Страхиња Радић) (HEAD -> master) </div><!--git-log--> diff --git a/slweb.1.in b/slweb.1.in @@ -83,9 +83,8 @@ Print this usage information screen. .br Set .I URL -as a global prefix for relative links. For example, this can be useful when -generating Gemini code which needs to keep relative links pointing to web URLs. -. +as a global prefix for relative links. +.. .TP .B \-v .TQ diff --git a/slweb.c b/slweb.c @@ -1353,8 +1353,10 @@ process_timestamp(FILE* output, const uint8_t* link_prefix, const char* link, ptimestamp_format++; } - print_output(output, "<a href=\"%s%s\"" + print_output(output, "<a href=\"%s%s%s\"" " class=\"timestamp\">%s%s</a>\n", + url_is_local(link) && global_link_prefix + ? (const char*)global_link_prefix : "", url_is_local(link) && link_prefix ? (const char*)link_prefix : "", link, @@ -1700,7 +1702,8 @@ int process_inline_link(uint8_t* link_text, const uint8_t* link_prefix, uint8_t* link_macro_body, uint8_t* link_url, FILE* output) { - print_output(output, "<a href=\"%s%s\">%s%s</a>", + print_output(output, "<a href=\"%s%s%s\">%s%s</a>", + global_link_prefix ? (const char*)global_link_prefix : "", link_prefix ? (const char*)link_prefix : "", link_url ? (char*)link_url : "", link_macro_body ? (char*)link_macro_body : "", @@ -1727,8 +1730,9 @@ process_inline_image(uint8_t* image_text, const uint8_t* link_prefix, print_output(output, "<figure>\n"); if (add_link) - print_output(output, "<a href=\"%s%s\" title=\"%s\" class=\"image\"" + print_output(output, "<a href=\"%s%s%s\" title=\"%s\" class=\"image\"" " target=\"_blank\">", + global_link_prefix ? (const char*)global_link_prefix : "", link_prefix ? (const char*)link_prefix : "", image_url ? (char*)image_url : "", image_text);