[format.c] remove brackets from link output, show them via css

This commit is contained in:
opfez 2021-09-24 13:41:03 +02:00
parent e8754b46b5
commit 0ce9a4ffb3
2 changed files with 20 additions and 4 deletions

View File

@ -158,7 +158,7 @@ emit_external_link(FILE *input, FILE *output)
char linkname[1024];
get_linkname(input, linkname);
fprintf(output, "<a href=\"%s\">[%s]</a>", link, linkname);
fprintf(output, "<a href=\"%s\" rel=\"external\">%s</a>", 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, "<a href=\"%s.html\">{%s}</a>", link, page);
fprintf(output, "<a href=\"%s.html\">%s</a>", 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, "<a href=\"%s\">{%s}</a>", page, linkname);
fprintf(output, "<a href=\"%s\">%s</a>", page, linkname);
else
fprintf(output, "<a href=\"%s.html\">{%s}</a>", page, linkname);
fprintf(output, "<a href=\"%s.html\">%s</a>", page, linkname);
}
void

View File

@ -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;