From 0ce9a4ffb3acac1a3d26961e7734fd5a8b67a2e3 Mon Sep 17 00:00:00 2001 From: opfez Date: Fri, 24 Sep 2021 13:41:03 +0200 Subject: [PATCH] [format.c] remove brackets from link output, show them via css --- format.c | 8 ++++---- resources/style-formatted.css | 16 ++++++++++++++++ 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/format.c b/format.c index 1543919..956425e 100644 --- a/format.c +++ b/format.c @@ -158,7 +158,7 @@ emit_external_link(FILE *input, FILE *output) char linkname[1024]; get_linkname(input, linkname); - fprintf(output, "[%s]", link, linkname); + fprintf(output, "%s", link, linkname); } void @@ -178,7 +178,7 @@ emit_internal_implicit_link(FILE *input, FILE *output) for (size_t i = 0; page[i] != '\0'; i++) if (page[i] == '-') page[i] = ' '; - fprintf(output, "{%s}", link, page); + fprintf(output, "%s", link, page); } bool @@ -204,9 +204,9 @@ emit_internal_explicit_link(FILE *input, FILE *output) get_linkname(input, linkname); if (explicit_link_extension(page)) - fprintf(output, "{%s}", page, linkname); + fprintf(output, "%s", page, linkname); else - fprintf(output, "{%s}", page, linkname); + fprintf(output, "%s", page, linkname); } void diff --git a/resources/style-formatted.css b/resources/style-formatted.css index 99164fe..3856097 100644 --- a/resources/style-formatted.css +++ b/resources/style-formatted.css @@ -13,6 +13,22 @@ a { text-decoration: none; } +a:before { + content: "{"; +} + +a:after { + content: "}"; +} + +a[rel="external"]:before { + content: "["; +} + +a[rel="external"]:after { + content: "]"; +} + a:hover { color: NORMALBG; background: FG;