RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.
Go agent-harnessagent-native-databaseagentic-aiagentic-retrievalagentic-searchaiai-agentscontext-enginecontext-engineeringcontext-managementharness-engineeringknowledge-compilationragretrieval-augmented-generationretrieval-harnesssearch-harness
/**
* Horizontal Rule transformer for markdown import/export
* Uses a custom inline node type to represent horizontal rules in Lexical.
*/
import { type ElementTransformer } from '@lexical/markdown';
import { type LexicalNode } from 'lexical';
import {
$createHorizontalRuleNode,
$isHorizontalRuleNode,
HorizontalRuleNode,
} from './horizontal-rule-node';
export const HR_TRANSFORMER: ElementTransformer = {
dependencies: [HorizontalRuleNode],
export: (node: LexicalNode) => {
return $isHorizontalRuleNode(node) ? '---' : null;
},
regExp: /^(---|\*\*\*|___)\s?$/,
replace: (parentNode, _1, _2, isImport) => {
const line = $createHorizontalRuleNode();
if (isImport || parentNode.getNextSibling() != null) {
parentNode.replace(line);
} else {
parentNode.insertBefore(line);
}
line.selectNext();
},
type: 'element',
};