[format.c] remove brackets from link output, show them via css
This commit is contained in:
parent
e8754b46b5
commit
0ce9a4ffb3
8
format.c
8
format.c
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue