Radish alpha
r
rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5
Radicle web interface
Radicle
Git
Enable markdown single line breaks unless it's a Blob component
Merged did:key:z6MkkfM3...sVz5 opened 2 years ago
7 files changed +12 -4 89ea5f90 4cbc6222
modified src/components/Comment.svelte
@@ -188,7 +188,7 @@
            state = "read";
          }} />
      {:else}
-
        <Markdown {rawPath} content={body} />
+
        <Markdown breaks {rawPath} content={body} />
      {/if}
    </div>
  {/if}
modified src/components/ExtendedTextarea.svelte
@@ -193,7 +193,7 @@
  </Radio>
  {#if preview}
    <div class="preview">
-
      <Markdown {rawPath} content={body} {embeds} />
+
      <Markdown breaks {rawPath} {embeds} content={body} />
    </div>
  {:else}
    <input
modified src/components/Markdown.svelte
@@ -29,6 +29,8 @@
  // If present, means we are in a preview context,
  // use this for image previews instead of /raw URLs.
  export let embeds: Map<string, Embed> | undefined = undefined;
+
  // If true, add <br> on a single line break
+
  export let breaks: boolean = false;

  let container: HTMLElement;
  let frontMatter: [string, any][] | undefined = undefined;
@@ -93,6 +95,7 @@
    return dompurify.sanitize(
      markdown.parse(content, {
        renderer: new Renderer(linkBaseUrl, false),
+
        breaks,
      }) as string,
    );
  }
modified src/views/projects/Cob/Revision.svelte
@@ -460,6 +460,7 @@
          {:else if revisionDescription && !first}
            <div class="revision-description txt-small">
              <Markdown
+
                breaks
                rawPath={rawPath(revisionBase)}
                content={revisionDescription} />
            </div>
modified src/views/projects/Issue.svelte
@@ -581,6 +581,7 @@
              }} />
          {:else if issue.discussion[0].body}
            <Markdown
+
              breaks
              content={issue.discussion[0].body}
              rawPath={rawPath(project.head)} />
          {:else}
modified src/views/projects/Patch.svelte
@@ -821,7 +821,10 @@
                  }
                }} />
            {:else if description}
-
              <Markdown content={description} rawPath={rawPath(patch.id)} />
+
              <Markdown
+
                breaks
+
                content={description}
+
                rawPath={rawPath(patch.id)} />
            {:else}
              <span class="txt-missing">No description available</span>
            {/if}
modified src/views/projects/Source/Blob.svelte
@@ -217,7 +217,7 @@
  {:else if preview && blob.content}
    {#if isMarkdown}
      <div style:padding="2rem">
-
        <Markdown {linkBaseUrl} content={blob.content} {rawPath} {path} />
+
        <Markdown {rawPath} {path} {linkBaseUrl} content={blob.content} />
      </div>
    {:else if isSvg}
      <div style:margin="1rem 0" style:text-align="center">