Skip to content

Commit e84060f

Browse files
Use marked to parse markdown in function fields
1 parent 79f2e2f commit e84060f

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

web/package-lock.json

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

web/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"@astrojs/starlight": "^0.31.1",
1414
"@multitheftauto/starlight-theme-mtasa": "^1.3.0",
1515
"astro": "^5.1.5",
16+
"marked": "^15.0.6",
1617
"sharp": "^0.32.5"
1718
},
1819
"optionalDependencies": {

web/src/pages/[func].astro

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import StarlightPage from '@astrojs/starlight/components/StarlightPage.astro';
33
import { getCollection } from 'astro:content';
44
import { getFunctionInfo } from '@src/utils/functions';
5+
import { marked } from 'marked';
56
67
export async function getStaticPaths() {
78
const functions = await getCollection('functions');
@@ -32,5 +33,6 @@ const funcPair = funcInfo.pair;
3233
<p>Pair: <a href={ funcPair }>{ funcPair }</a></p>
3334
)}
3435

35-
<p>{ funcInfo.description }</p>
36+
<!-- Description -->
37+
<Fragment set:html={marked(funcInfo.description)} />
3638
</StarlightPage>

0 commit comments

Comments
 (0)