AppFlowy/frontend/appflowy_flutter/lib/shared/markdown_to_document.dart
Lucas 8726df703e fix: hotfix issues for v0.7.7 (#6948)
* fix: include link preview block and file block in exported markdown

* test: include link preview block and file block in exported markdown

* chore: remove unused logs

* chore: update editor version

* fix: "+" menu should be close after pressing space

* test: cancel inline page reference menu by space

* chore: update editor version

* chore: remove unused logs
2024-12-09 16:20:36 +08:00

27 lines
739 B
Dart

import 'package:appflowy/plugins/document/presentation/editor_plugins/plugins.dart';
import 'package:appflowy_editor/appflowy_editor.dart';
Document customMarkdownToDocument(String markdown) {
return markdownToDocument(
markdown,
markdownParsers: [
const MarkdownCodeBlockParser(),
const MarkdownSimpleTableParser(),
],
);
}
String customDocumentToMarkdown(Document document) {
return documentToMarkdown(
document,
customParsers: [
const MathEquationNodeParser(),
const CalloutNodeParser(),
const ToggleListNodeParser(),
const CustomImageNodeParser(),
const SimpleTableNodeParser(),
const LinkPreviewNodeParser(),
const FileBlockNodeParser(),
],
);
}