Skip to content

Commit

Permalink
fix: unable to export image block in markdown format (#713)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
rileyhawk1417 and LucasXu0 authored Feb 18, 2024
1 parent 66762ef commit 96fc5b5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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]})';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ void main() async {
final node = Node(
type: 'image',
attributes: {
'image_src': 'https://appflowy.io',
'url': 'https://appflowy.io',
},
);

Expand Down

0 comments on commit 96fc5b5

Please sign in to comment.