🚸 Rewrite the markdown deserializer to improve br… (#1198)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Refactor** - Updated markdown handling and serialization libraries for improved performance and accuracy in text formatting. - **New Features** - Enhanced rich text and markdown conversion capabilities, providing users with more reliable and seamless text formatting options. - **Documentation** - Added detailed documentation for markdown to rich text conversion and vice versa, ensuring easier understanding and implementation for developers. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
import { TDescendant, Value } from '@udecode/plate-common'
|
||||
|
||||
import { remarkTransformNode } from './remarkTransformNode'
|
||||
import { MdastNode, RemarkPluginOptions } from './types'
|
||||
|
||||
export const remarkTransformElementChildren = <V extends Value>(
|
||||
node: MdastNode,
|
||||
lastLineNumber: number,
|
||||
options: RemarkPluginOptions<V>
|
||||
): TDescendant[] => {
|
||||
const { children } = node
|
||||
if (!children) return []
|
||||
|
||||
return children.flatMap((child) =>
|
||||
remarkTransformNode(child, lastLineNumber, options)
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user