From 95301a41ff67fd30f2bcd842dbd0bb4ae82b5e3d Mon Sep 17 00:00:00 2001 From: Zef Hemel Date: Sun, 12 Nov 2023 12:08:09 +0100 Subject: [PATCH] Fixes #558 --- plugs/markdown/assets/markdown_widget.css | 21 +++++++++++++++++++++ plugs/markdown/markdown_render.ts | 9 ++++++++- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/plugs/markdown/assets/markdown_widget.css b/plugs/markdown/assets/markdown_widget.css index dcf23f5b..ac92a08a 100644 --- a/plugs/markdown/assets/markdown_widget.css +++ b/plugs/markdown/assets/markdown_widget.css @@ -47,6 +47,27 @@ ul li::before { /* Also needed for space (tweak if needed) */ } +h1, +h2, +h3, +h4, +h5 { + margin: 0; +} + +a.wiki-link { + border-radius: 5px; + padding: 0 5px; + color: var(--editor-wiki-link-page-color); + background-color: var(--editor-wiki-link-page-background-color); + text-decoration: none; +} + +span.task-deadline { + background-color: rgba(22, 22, 22, 0.07); +} + + body:hover #button-bar, body:active #button-bar { diff --git a/plugs/markdown/markdown_render.ts b/plugs/markdown/markdown_render.ts index 4a944283..b8256ae5 100644 --- a/plugs/markdown/markdown_render.ts +++ b/plugs/markdown/markdown_render.ts @@ -248,6 +248,7 @@ function render( name: "a", attrs: { href: `/${ref.replace("@", "#")}`, + class: "wiki-link", "data-ref": ref, }, body: linkText, @@ -333,7 +334,13 @@ function render( } case "DeadlineDate": - return renderToText(t); + return { + name: "span", + attrs: { + class: "task-deadline", + }, + body: renderToText(t), + }; // Tables case "Table":