Radish alpha
r
Radicle web interface
Radicle
Git (anonymous pull)
Log in to clone via SSH
Fix padding and linebreaks in markdown
Sebastian Martinez committed 3 years ago
commit 380366be2e8fe196326673f3423d23f6f19d8112
parent bb9ea851fc6e6153538ecb9bbfca3a80394231c9
2 files changed +2 -13
modified src/components/Markdown.svelte
@@ -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) {
modified src/lib/markdown.ts
@@ -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.