fix: refactor stuff
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
import { Component, createSignal, createEffect, onCleanup, Show, createResource } from 'solid-js';
|
||||
import { parseMarkdown } from '../markdown';
|
||||
import { fetchData, extractSection } from '../data-loader';
|
||||
import { extractSection } from '../data-loader';
|
||||
import mermaid from 'mermaid';
|
||||
import {getIndexedData} from "../data-loader/file-index";
|
||||
|
||||
export interface ArticleProps {
|
||||
src: string;
|
||||
@@ -12,7 +13,7 @@ export interface ArticleProps {
|
||||
}
|
||||
|
||||
async function fetchArticleContent(params: { src: string; section?: string }): Promise<string> {
|
||||
const text = await fetchData(params.src);
|
||||
const text = await getIndexedData(params.src);
|
||||
// 如果指定了 section,提取对应内容
|
||||
return params.section ? extractSection(text, params.section) : text;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user