Skip to content

Commit 67c736a

Browse files
committed
Update index.tsx
1 parent ce89d44 commit 67c736a

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

src/theme/MDXPage/index.tsx

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -25,44 +25,44 @@ export default function MDXPage(props: ComponentProps<typeof OriginalMDXPage>) {
2525
try {
2626
// Access the raw content if available
2727
const rawContent = (MDXPageContent as any).__rawContent || (MDXPageContent as any).rawContent || (MDXPageContent as any).content
28-
28+
2929
if (!rawContent) return null
3030

3131
// Remove frontmatter (everything before the first paragraph)
3232
const contentWithoutFrontmatter = rawContent.split('---').slice(2).join('---').trim()
33-
33+
3434
// Remove imports and other non-content lines
3535
const lines = contentWithoutFrontmatter.split('\n')
3636
const contentLines = lines.filter(line => {
3737
const trimmed = line.trim()
38-
return !trimmed.startsWith('import ') &&
39-
!trimmed.startsWith('export ') &&
40-
trimmed !== ''
38+
return !trimmed.startsWith('import ') &&
39+
!trimmed.startsWith('export ') &&
40+
trimmed !== ''
4141
})
42-
42+
4343
// Extract paragraphs (non-empty lines that don't start with #, -, *, etc.)
4444
const paragraphs = []
4545
let currentParagraph = ''
46-
46+
4747
for (const line of contentLines) {
4848
const trimmed = line.trim()
49-
49+
5050
// Skip headers, lists, code blocks, and other markdown syntax
51-
if (trimmed.startsWith('#') ||
52-
trimmed.startsWith('-') ||
53-
trimmed.startsWith('*') ||
54-
trimmed.startsWith('```') ||
55-
trimmed.startsWith(':::') ||
56-
trimmed.startsWith('1.') ||
57-
trimmed.startsWith('2.') ||
58-
trimmed.startsWith('3.')) {
51+
if (trimmed.startsWith('#') ||
52+
trimmed.startsWith('-') ||
53+
trimmed.startsWith('*') ||
54+
trimmed.startsWith('```') ||
55+
trimmed.startsWith(':::') ||
56+
trimmed.startsWith('1.') ||
57+
trimmed.startsWith('2.') ||
58+
trimmed.startsWith('3.')) {
5959
if (currentParagraph.trim()) {
6060
paragraphs.push(currentParagraph.trim())
6161
currentParagraph = ''
6262
}
6363
continue
6464
}
65-
65+
6666
if (trimmed === '') {
6767
if (currentParagraph.trim()) {
6868
paragraphs.push(currentParagraph.trim())
@@ -72,12 +72,12 @@ export default function MDXPage(props: ComponentProps<typeof OriginalMDXPage>) {
7272
currentParagraph += (currentParagraph ? ' ' : '') + trimmed
7373
}
7474
}
75-
75+
7676
// Add any remaining paragraph
7777
if (currentParagraph.trim()) {
7878
paragraphs.push(currentParagraph.trim())
7979
}
80-
80+
8181
// Return first two paragraphs
8282
return paragraphs.slice(0, 2)
8383
} catch (error) {
@@ -129,7 +129,7 @@ export default function MDXPage(props: ComponentProps<typeof OriginalMDXPage>) {
129129
<div className="row">
130130
<div className="col col--8 col--offset-1">
131131
<div className={styles.titleContainer}>
132-
<img className={styles.cover} src={"https://docs.metamask.io/" + image} alt="Cover" />
132+
{/* <img className={styles.cover} src={"https://docs.metamask.io/" + image} alt="Cover" /> */}
133133
<div className={styles.titleContainer}>
134134
<h1 className={styles.title}>{title}</h1>
135135
<div className={styles.topMenu}>
@@ -236,7 +236,7 @@ export default function MDXPage(props: ComponentProps<typeof OriginalMDXPage>) {
236236
)}
237237
</BrowserOnly>
238238
</div>
239-
<DiscourseComment
239+
<DiscourseComment
240240
postUrl={url}
241241
discourseTopicId={discourse_topic_id}
242242
metadata={{ title, image, description, tags, author, date }}

0 commit comments

Comments
 (0)