Improve link highlighting

- Metadata key highlighting
- Don't show "[[", "]]" around links
This commit is contained in:
Peter Stuifzand 2021-08-08 14:50:57 +02:00
parent 5000ab768a
commit dec8e85064
2 changed files with 13 additions and 7 deletions

View File

@ -358,7 +358,7 @@ function Editor(holder, input) {
let re = /^([A-Z0-9 ]+)::\s*(.+)$/i; let re = /^([A-Z0-9 ]+)::\s*(.+)$/i;
let res = text.match(re) let res = text.match(re)
if (res) { if (res) {
converted = '**[[' + res[1] + ']]**: ' + res[2] converted = '<span class="metadata-key">[[' + res[1] + ']]</span>: ' + res[2]
} else if (text.match(/#\[\[TODO]]/)) { } else if (text.match(/#\[\[TODO]]/)) {
converted = converted.replace('#[[TODO]]', '<input class="checkbox" type="checkbox" />') converted = converted.replace('#[[TODO]]', '<input class="checkbox" type="checkbox" />')
todo = true; todo = true;

View File

@ -48,15 +48,21 @@ body {
font-family: 'Inter', sans-serif; font-family: 'Inter', sans-serif;
} }
.highlight-links {
.content a.wiki-link::before { .content a.wiki-link::before {
content: "[["; content: "[[";
color: #ccc; color: #ccc;
} }
.content a.wiki-link::after { .content a.wiki-link::after {
content: "]]"; content: "]]";
color: #ccc; color: #ccc;
} }
}
.metadata-key a {
font-weight: bold;
color: black;
}
@supports (font-variation-settings: normal) { @supports (font-variation-settings: normal) {
html { html {