Radish alpha
r
rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5
Radicle web interface
Radicle
Git
Remove InlineMarkdown component
Sebastian Martinez committed 1 year ago
commit e4b15e72544e576a40d694b5d473ec5868b7f1b6
parent 4b579d1
2 files changed +9 -44
deleted src/components/InlineMarkdown.svelte
@@ -1,42 +0,0 @@
-
<script lang="ts">
-
  import dompurify from "dompurify";
-

-
  import markdown from "@app/lib/markdown";
-
  import { twemoji } from "@app/lib/utils";
-
  import { activeUnloadedRouteStore } from "@app/lib/router";
-
  import { Renderer } from "@app/lib/markdown";
-

-
  export let content: string;
-
  export let fontSize: "tiny" | "small" | "regular" | "medium" | "large" =
-
    "small";
-

-
  const render = (content: string): string =>
-
    dompurify.sanitize(
-
      markdown.parseInline(content, {
-
        renderer: new Renderer($activeUnloadedRouteStore),
-
      }) as string,
-
    );
-
</script>
-

-
<style>
-
  .markdown :global(code) {
-
    font-family: var(--font-family-monospace);
-
    background-color: var(--color-fill-ghost);
-
    border-radius: var(--border-radius-tiny);
-
    padding: 0.125rem 0.25rem;
-
  }
-
  .markdown :global(strong) {
-
    font-weight: var(--font-weight-semibold);
-
  }
-
</style>
-

-
<span
-
  class="markdown"
-
  use:twemoji
-
  class:txt-large={fontSize === "large"}
-
  class:txt-medium={fontSize === "medium"}
-
  class:txt-regular={fontSize === "regular"}
-
  class:txt-small={fontSize === "small"}
-
  class:txt-tiny={fontSize === "tiny"}>
-
  {@html render(content)}
-
</span>
modified src/views/projects/Source/ProjectNameHeader.svelte
@@ -1,13 +1,14 @@
<script lang="ts">
  import type { BaseUrl, Project } from "@http-client";

+
  import dompurify from "dompurify";
+
  import { markdownWithExtensions } from "@app/lib/markdown";
  import { twemoji } from "@app/lib/utils";

  import Badge from "@app/components/Badge.svelte";
  import CloneButton from "@app/views/projects/Header/CloneButton.svelte";
  import IconSmall from "@app/components/IconSmall.svelte";
  import Id from "@app/components/Id.svelte";
-
  import InlineMarkdown from "@app/components/InlineMarkdown.svelte";
  import Link from "@app/components/Link.svelte";
  import SeedButton from "@app/views/projects/Header/SeedButton.svelte";
  import Share from "@app/views/projects/Share.svelte";
@@ -15,6 +16,12 @@
  export let project: Project;
  export let baseUrl: BaseUrl;
  export let seeding: boolean;
+

+
  function render(content: string): string {
+
    return dompurify.sanitize(
+
      markdownWithExtensions.parseInline(content) as string,
+
    );
+
  }
</script>

<style>
@@ -94,5 +101,5 @@
  </div>
</div>
<div class="description" use:twemoji>
-
  <InlineMarkdown fontSize="regular" content={project.description} />
+
  {render(project.description)}
</div>