Fix padding and linebreaks in markdown

Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
This commit is contained in:
Sebastian Martinez
2023-05-17 12:55:43 +02:00
parent bb9ea851fc
commit 380366be2e
2 changed files with 2 additions and 13 deletions
+2 -2
View File
@@ -187,7 +187,7 @@
margin-bottom: 0.625rem;
}
.markdown :global(p:last-child) {
.markdown :global(p:only-child) {
margin-bottom: 0;
}
@@ -282,7 +282,7 @@
margin: 1rem 0;
}
/* Allows the parent to specify its own bottom margin */
.markdown :global(:last-child) {
.markdown :global(> :last-child) {
margin-bottom: 0;
}
.markdown :global(li > ul) {
-11
View File
@@ -132,17 +132,6 @@ export const renderer = {
return `<h${level} id="${escapedText}">${text}</h${level}>`;
},
listitem(text: string) {
const hasLineBreaks = text.trim().indexOf("\n");
if (hasLineBreaks === -1) {
return `<li>${text}</li>`;
}
const [first, ...remaining] = text.trim().split("\n");
const liContent = `${first}<div class="list-content">${remaining.join(
"\n",
)}</div>`;
return `<li>${liContent}</li>`;
},
link(href: string, _title: string, text: string) {
// Adding the file-link class to relative file names,
// so we're able to navigate to the file in the editor.