mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-16 03:40:37 +08:00
Fix padding and linebreaks in markdown
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user