Feat: Enable the wiki's Markdown editor to navigate to a new Markdown file when a link is clicked. (#17019)

This commit is contained in:
balibabu
2026-07-17 11:22:18 +08:00
committed by GitHub
parent f69ed74670
commit 677960716e
12 changed files with 688 additions and 194 deletions

View File

@@ -7,12 +7,14 @@ interface MarkdownEditorProps {
content: string;
onChange?: (content: string) => void;
readOnly?: boolean;
onWikiLinkClick?: (pageType: 'concept' | 'entity', slug: string) => void;
}
export default function MarkdownEditor({
content,
onChange,
readOnly = false,
onWikiLinkClick,
}: MarkdownEditorProps) {
const [showSource, setShowSource] = useState(false);
const [rawContent, setRawContent] = useState(content);
@@ -61,6 +63,7 @@ export default function MarkdownEditor({
placeholder={readOnly ? '' : 'Start writing...'}
onToggleSource={toggleSource}
showSource={showSource}
onWikiLinkClick={onWikiLinkClick}
/>
</div>
<div