mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2025-08-01 21:37:38 +00:00
31 lines
785 B
Dart
31 lines
785 B
Dart
import 'package:appflowy/plugins/document/presentation/editor_plugins/plugins.dart';
|
|
import 'package:appflowy_editor/appflowy_editor.dart';
|
|
|
|
Document customMarkdownToDocument(
|
|
String markdown, {
|
|
double? tableWidth,
|
|
}) {
|
|
return markdownToDocument(
|
|
markdown,
|
|
markdownParsers: [
|
|
const MarkdownCodeBlockParser(),
|
|
MarkdownSimpleTableParser(tableWidth: tableWidth),
|
|
],
|
|
);
|
|
}
|
|
|
|
String customDocumentToMarkdown(Document document) {
|
|
return documentToMarkdown(
|
|
document,
|
|
customParsers: [
|
|
const MathEquationNodeParser(),
|
|
const CalloutNodeParser(),
|
|
const ToggleListNodeParser(),
|
|
const CustomImageNodeParser(),
|
|
const SimpleTableNodeParser(),
|
|
const LinkPreviewNodeParser(),
|
|
const FileBlockNodeParser(),
|
|
],
|
|
);
|
|
}
|