File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change 88 import { page } from " $app/state" ;
99 import Check from " phosphor-svelte/lib/Check" ;
1010 import CopyPageDropdown from " ./copy-page-dropdown.svelte" ;
11+ import { parseMarkdown } from " $lib/utils/markdown.js" ;
1112
1213 let { metadata }: { metadata: DocMetadata } = $props ();
1314
2829 <span aria-hidden =" true" class =" hidden" > Documentation </span >
2930 </PageHeaderHeading >
3031 <PageHeaderDescription class ={metadata .llms ? " " : " mb-11" }
31- >{metadata .description }</PageHeaderDescription
32+ >{@html parseMarkdown ( metadata .description , undefined ) }</PageHeaderDescription
3233 >
3334 {#if metadata .llms }
3435 <span aria-hidden =" true" class =" hidden" >
Original file line number Diff line number Diff line change 1- export function parseMarkdown ( text : string ) {
1+
2+ //
3+ export function parseMarkdown ( text : string , codeFontSize : number | undefined = 12 ) {
4+ const codeClass = codeFontSize ? `text-[${ codeFontSize } px]!` : '' ;
25 return text
3- . replace ( / ` ( [ ^ ` ] + ) ` / g, " <Code neutral class='text-[12px]! '>$1</Code>" )
6+ . replace ( / ` ( [ ^ ` ] + ) ` / g, ` <Code neutral class='${ codeClass } '>$1</Code>` )
47 . replace ( / \* \* ( [ ^ * ] + ) \* \* / g, "<strong>$1</strong>" )
58 . replace ( / \* ( [ ^ * ] + ) \* / g, "<em>$1</em>" )
69 . replace ( / _ ( [ ^ _ ] + ) _ / g, "<em>$1</em>" )
You can’t perform that action at this time.
0 commit comments