mirror of
https://github.com/langgenius/dify.git
synced 2026-03-26 08:40:14 +08:00
chore: rename md comp
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
'use client'
|
||||
import { DirectiveMarkdownRenderer } from './directive-markdown-renderer'
|
||||
import { MarkdownWithDirective } from '@/app/components/base/markdown-with-directive'
|
||||
|
||||
const markdown = `
|
||||
We’re speaking with technical teams to better understand:
|
||||
@ -29,8 +29,8 @@ export default function RemarkDirectiveTestPage() {
|
||||
<h1 style={{ fontSize: 20, fontWeight: 600, marginBottom: 16 }}>
|
||||
remark-directive test page
|
||||
</h1>
|
||||
<div>
|
||||
<DirectiveMarkdownRenderer markdown={markdown} />
|
||||
<div className="markdown-body">
|
||||
<MarkdownWithDirective markdown={markdown} />
|
||||
</div>
|
||||
</main>
|
||||
)
|
||||
|
||||
@ -2,8 +2,8 @@ import type { Components } from 'react-markdown'
|
||||
import ReactMarkdown from 'react-markdown'
|
||||
import remarkDirective from 'remark-directive'
|
||||
import { visit } from 'unist-util-visit'
|
||||
import { WithIconItem, WithIconList } from './directive-components'
|
||||
import { directivePropsSchemas } from './directive-props-schema'
|
||||
import { WithIconItem, WithIconList } from './markdown-with-directive-components'
|
||||
import { directivePropsSchemas } from './markdown-with-directive-schema'
|
||||
|
||||
type DirectiveNode = {
|
||||
type?: string
|
||||
@ -177,11 +177,11 @@ const directiveComponents = {
|
||||
withiconitem: WithIconItem,
|
||||
} as unknown as Components
|
||||
|
||||
type DirectiveMarkdownRendererProps = {
|
||||
type MarkdownWithDirectiveProps = {
|
||||
markdown: string
|
||||
}
|
||||
|
||||
export function DirectiveMarkdownRenderer({ markdown }: DirectiveMarkdownRendererProps) {
|
||||
export function MarkdownWithDirective({ markdown }: MarkdownWithDirectiveProps) {
|
||||
const normalizedMarkdown = normalizeDirectiveAttributeBlocks(markdown)
|
||||
|
||||
return (
|
||||
@ -1,5 +1,5 @@
|
||||
import type { ReactNode } from 'react'
|
||||
import type { WithIconItemDirectiveProps, WithIconListDirectiveProps } from './directive-props-schema'
|
||||
import type { WithIconItemDirectiveProps, WithIconListDirectiveProps } from './markdown-with-directive-schema'
|
||||
|
||||
type WithIconListProps = WithIconListDirectiveProps & {
|
||||
children?: ReactNode
|
||||
Reference in New Issue
Block a user