Skip to content

Commit e28abb7

Browse files
committed
Use EnhancedMarkdown for descriptions
1 parent 046c7e0 commit e28abb7

File tree

5 files changed

+10
-6
lines changed

5 files changed

+10
-6
lines changed

web/src/components/ItemDescription.astro

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
import { marked } from 'marked';
3+
import EnhancedMarkdown from './EnhancedMarkdown.astro';
34
45
interface Props {
56
description: string;
@@ -16,5 +17,5 @@ path = path.endsWith('/') ? path.slice(0, -1) : path;
1617
<br>Please finish this page using the <a target="_blank" href={"https://wiki.multitheftauto.com/wiki" + path}>corresponding Old Wiki article</a>.
1718
<br>Go to <a target="_blank" href="https://github.com/multitheftauto/wiki.multitheftauto.com/blob/main/CONTRIBUTING.md">Contribution guidelines</a> for more information.</p>
1819
) : (
19-
<Fragment set:html={marked(description)} />
20+
<EnhancedMarkdown content={description} />
2021
)}

web/src/pages/[element].astro

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { getElementCategory, getOOPFunctionsForElement } from '@src/utils/elemen
1010
import SeeAlsoSection from '@src/components/SeeAlsoSection.astro';
1111
import CodeExamplesSection from '@src/components/CodeExamplesSection.astro';
1212
import ElementOOPInfo from '@src/components/ElementOOPInfo.astro';
13+
import EnhancedMarkdown from '@src/components/EnhancedMarkdown.astro';
1314
1415
export async function getStaticPaths() {
1516
const elements = await getCollection('elements');
@@ -45,7 +46,7 @@ let oop_compatible_functions = getOOPFunctionsForElement(element.data.name);
4546
}}>
4647
<p><a href="/Element">Element</a> category: <strong>{getElementCategory(element)}</strong></p>
4748

48-
<Fragment set:html={marked(element.data.description)} />
49+
<EnhancedMarkdown content={element.data.description} />
4950

5051
<ElementOOPInfo
5152
element_name={element.data.name}

web/src/pages/[event].astro

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import type { NotesType } from '@src/utils/types';
1313
import SeeAlsoSection from '@src/components/SeeAlsoSection.astro';
1414
import CodeExamplesSection from '@src/components/CodeExamplesSection.astro';
1515
import ItemDescription from '@src/components/ItemDescription.astro';
16+
import EnhancedMarkdown from '@src/components/EnhancedMarkdown.astro';
1617
1718
export async function getStaticPaths() {
1819
const events = await getCollection('events');
@@ -78,7 +79,7 @@ if (Array.isArray(event.data.notes) && event.data.notes.length > 0) {
7879
<div class="notes-section">
7980
{notesContent.map((note) => (
8081
<NoteBox type={note.type}>
81-
<Fragment set:html={marked(note.content)} />
82+
<EnhancedMarkdown content={note.content}/>
8283
</NoteBox>
8384
))}
8485
</div>

web/src/pages/[func].astro

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import CodeExamplesSection from '@src/components/CodeExamplesSection.astro';
1616
1717
import ChangelogList from '@src/components/ChangelogList.astro';
1818
import ItemDescription from '@src/components/ItemDescription.astro';
19+
import EnhancedMarkdown from '@src/components/EnhancedMarkdown.astro';
1920
2021
export async function getStaticPaths() {
2122
const functions = await getCollection('functions');
@@ -96,7 +97,7 @@ let funcSyntaxes = parseFunctionSyntaxes(func.id, func.data);
9697
<div class="notes-section">
9798
{notesContent.map((note) => (
9899
<NoteBox type={note.type}>
99-
<Fragment set:html={marked(note.content)} />
100+
<EnhancedMarkdown content={note.content} />
100101
</NoteBox>
101102
))}
102103
</div>
@@ -185,7 +186,8 @@ let funcSyntaxes = parseFunctionSyntaxes(func.id, func.data);
185186
<li set:html={"<strong>" + ret.type + "</strong>: " + renderInlineMarkdown(ret.name)} />
186187
))}
187188
</ul>
188-
<Fragment set:html={marked(syntax.returns.description)} />
189+
190+
<EnhancedMarkdown content={syntax.returns.description}/>
189191
)}
190192
</div>
191193
))}

web/src/pages/[theType].astro

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
import StarlightPage from '@astrojs/starlight/components/StarlightPage.astro';
33
import { getCollection } from 'astro:content';
4-
import { marked } from 'marked';
54
import EnhancedMarkdown from '@src/components/EnhancedMarkdown.astro';
65
76
export async function getStaticPaths() {

0 commit comments

Comments
 (0)