Skip to content

Commit

Permalink
style: markdown hint to the bottom right
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Junk committed Nov 27, 2023
1 parent 8247fdf commit b363c2f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/lib/KeyValue.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,13 @@
{#if key == "text" || key == "Text"}
<tr
><td class="key">{key}</td><td class="value">
<small class="hint">Markdown</small>
<div class="display-markdown">
{@html DOMPurify.sanitize(
marked.parse(values[index].replace(/^[\u200B\u200C\u200D\u200E\u200F\uFEFF]/, ""))
)}
<br />
</div>
<small class="hint">Markdown</small>
</td>
</tr>
{:else}
Expand Down
5 changes: 3 additions & 2 deletions src/lib/singleview/notes/Note.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,12 @@
<h5>Text</h5>
</div>

<div class="markdowntext">
<small class="hint">Markdown</small>
<div class="markdown-text">
<div class="display-markdown">
{@html DOMPurify.sanitize(
marked.parse(note.text.replace(/^[\u200B\u200C\u200D\u200E\u200F\uFEFF]/, ""))
)}
<br />
</div>
<small class="hint">Markdown</small>
</div>
7 changes: 6 additions & 1 deletion static/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -267,18 +267,23 @@ hr {

.hint {
background: lightgray;
position: absolute;
bottom: 0.25rem;
right: 0.25rem;
}

.keyvalue {
width: 100%;
overflow-x: auto;
}

.display-markdown {
.markdown-text {
margin-left: 1rem;
padding: 0.5rem;
border: 1px solid lightgray;
width: 100%;
overflow-x: auto;
position: relative;
}

.revisionhistory {
Expand Down

0 comments on commit b363c2f

Please sign in to comment.