From 96fc5b5ab00ae4f92b42565d12c9efd27bf0eb1a Mon Sep 17 00:00:00 2001 From: Sean Riley Hawkins Date: Sun, 18 Feb 2024 05:54:43 +0200 Subject: [PATCH] fix: unable to export image block in markdown format (#713) * fix: replace image_src with url attribute solves (null) bug on export * test: change test attribute value * Update lib/src/plugins/markdown/encoder/parser/image_node_parser.dart --------- Co-authored-by: Lucas.Xu --- lib/src/plugins/markdown/encoder/parser/image_node_parser.dart | 2 +- .../plugins/markdown/encoder/parser/image_node_parser_test.dart | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/src/plugins/markdown/encoder/parser/image_node_parser.dart b/lib/src/plugins/markdown/encoder/parser/image_node_parser.dart index 6bd5ce66d..29f361e5c 100644 --- a/lib/src/plugins/markdown/encoder/parser/image_node_parser.dart +++ b/lib/src/plugins/markdown/encoder/parser/image_node_parser.dart @@ -8,6 +8,6 @@ class ImageNodeParser extends NodeParser { @override String transform(Node node, DocumentMarkdownEncoder? encoder) { - return '![](${node.attributes['image_src']})'; + return '![](${node.attributes[ImageBlockKeys.url]})'; } } diff --git a/test/plugins/markdown/encoder/parser/image_node_parser_test.dart b/test/plugins/markdown/encoder/parser/image_node_parser_test.dart index cd34cb51c..46ee9a39c 100644 --- a/test/plugins/markdown/encoder/parser/image_node_parser_test.dart +++ b/test/plugins/markdown/encoder/parser/image_node_parser_test.dart @@ -7,7 +7,7 @@ void main() async { final node = Node( type: 'image', attributes: { - 'image_src': 'https://appflowy.io', + 'url': 'https://appflowy.io', }, );