File tree Expand file tree Collapse file tree 4 files changed +18
-24
lines changed
[pullOrIssue=poi]/[org]/[repo]/[id=number] Expand file tree Collapse file tree 4 files changed +18
-24
lines changed Original file line number Diff line number Diff line change 1
1
<script lang =" ts" >
2
- import Markdown from " svelte-exmarkdown" ;
2
+ /**
3
+ * Markdown block using Marked.js under the hood, with custom renderers
4
+ * for a cleaner look and using GitHub Flavored Markdown as an option
5
+ *
6
+ * @component
7
+ */
8
+ import Markdown , { type Plugin } from " svelte-exmarkdown" ;
3
9
import { gfmPlugin } from " svelte-exmarkdown/gfm" ;
4
10
import { cn } from " $lib/utils" ;
5
11
6
12
export let markdown: string ;
7
13
export let inline = false ;
14
+ export let additionalPlugins: Plugin [] = [];
8
15
9
16
let className: string | undefined | null = undefined ;
10
17
export { className as class };
17
24
className
18
25
)}
19
26
>
20
- <Markdown md ={markdown } plugins ={[gfmPlugin ()]} />
27
+ <Markdown md ={markdown } plugins ={[gfmPlugin (), ... additionalPlugins ]} />
21
28
</span >
Original file line number Diff line number Diff line change 37
37
bind:this ={data }
38
38
class:dark:font-bold ={data ?.innerText .startsWith (" breaking:" )}
39
39
class:font-semibold ={data ?.innerText .startsWith (" breaking:" )}
40
- class =" group *:inline-block "
40
+ class =" group *:inline"
41
41
>
42
42
<slot />
43
43
{#if allLinks .length > 0 }
44
44
<Button
45
45
href ={ghLinkToHref (allLinks [0 ] ?? " " )}
46
46
variant =" link"
47
- class =" ml-4 hidden h-auto -translate-x-2 p-0 opacity-0 transition-[transform,_opacity] duration-300 group-hover:translate-x-0 group-hover:opacity-100 md:inline-flex lg:mr-8"
47
+ class =" ml-2 !inline-flex h-auto p-0 transition-[transform,_opacity] duration-300 group-hover:translate-x-0 group-hover:opacity-100 md:ml-4 md:-translate-x-2 md:opacity-0 lg:mr-8"
48
48
>
49
49
Open details
50
50
<ArrowRight class =" ml-2 size-4" />
Original file line number Diff line number Diff line change 4
4
import ArrowUpRight from " lucide-svelte/icons/arrow-up-right" ;
5
5
import LoaderCircle from " lucide-svelte/icons/loader-circle" ;
6
6
import { MetaTags } from " svelte-meta-tags" ;
7
- import Markdown from " svelte-exmarkdown" ;
8
7
import semver from " semver" ;
9
- import { gfmPlugin } from " svelte-exmarkdown/gfm" ;
10
8
import type { Tab } from " ../types" ;
11
9
import { localStorageStore } from " $lib/localStorageStore" ;
12
10
import { tabState } from " $lib/tabState" ;
21
19
import * as Tooltip from " $lib/components/ui/tooltip" ;
22
20
import BlinkingBadge from " $lib/components/BlinkingBadge.svelte" ;
23
21
import ListElementRenderer from " $lib/renderers/ListElementRenderer.svelte" ;
22
+ import MarkdownRenderer from " $lib/components/MarkdownRenderer.svelte" ;
24
23
25
24
export let data;
26
25
620
619
<!-- Accordion content with markdown body and a link to open it on GitHub -->
621
620
<Accordion .Content >
622
621
<div class =" flex flex-col gap-4 sm:flex-row sm:justify-between sm:gap-0" >
623
- <div
624
- class =" prose prose-sm max-w-full dark:prose-invert prose-p:my-0 prose-a:no-underline prose-a:underline-offset-4 hover:prose-a:underline"
625
- >
626
- <!-- Markdown block using Marked.js under the hood, with custom renderers -->
627
- <!-- for clean look and using GitHub Flavored Markdown as an option -->
628
- <Markdown
629
- md ={releaseBody }
630
- plugins ={[
631
- {
632
- renderer: {
633
- li: ListElementRenderer
634
- }
635
- },
636
- gfmPlugin ()
637
- ]}
638
- />
639
- </div >
622
+ <MarkdownRenderer
623
+ markdown ={releaseBody }
624
+ additionalPlugins ={[{ renderer: { li: ListElementRenderer } }]}
625
+ class =" prose-sm max-w-full prose-p:my-0"
626
+ />
640
627
<!-- Open the release on GitHub in a new tab, with a nice hover animation -->
641
628
<Button
642
629
href ={release .html_url }
Original file line number Diff line number Diff line change 12
12
import * as Avatar from " $lib/components/ui/avatar" ;
13
13
import * as Tooltip from " $lib/components/ui/tooltip" ;
14
14
import GHBadge from " $lib/components/GHBadge.svelte" ;
15
+ import MarkdownRenderer from " $lib/components/MarkdownRenderer.svelte" ;
15
16
import Step from " $lib/components/Step.svelte" ;
16
17
import Steps from " $lib/components/Steps.svelte" ;
17
18
import BottomCollapsible from " ./BottomCollapsible.svelte" ;
18
- import MarkdownRenderer from " ./MarkdownRenderer.svelte" ;
19
19
20
20
// Utils
21
21
function formatToDateTime(date : string ) {
You can’t perform that action at this time.
0 commit comments