Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix md image export #713

Merged
merged 5 commits into from
Feb 18, 2024
Merged

Conversation

rileyhawk1417
Copy link
Contributor

When exporting the document to markdown the image would show up as ![](). The image url/src didn't get passed.

In the image_node_parser.dart its looking for the attribute image_src which doesnt exist.

  @override
  String transform(Node node, DocumentMarkdownEncoder? encoder) {
    return '![](${node.attributes['image_src']})';
  }

However when checking the attributes url is passed and not image_src

@LucasXu0
Copy link
Collaborator

@rileyhawk1417 This test failed.

    test('parser image node', () {
      final node = Node(
        type: 'image',
        attributes: {
          'image_src': 'https://appflowy.io',
        },
      );

      final result = const ImageNodeParser().transform(node, null);
      expect(result, '![](https://appflowy.io)');
    });

Copy link

codecov bot commented Feb 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (66762ef) 75.57% compared to head (4139362) 75.57%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #713   +/-   ##
=======================================
  Coverage   75.57%   75.57%           
=======================================
  Files         297      297           
  Lines       13735    13735           
=======================================
  Hits        10380    10380           
  Misses       3355     3355           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@LucasXu0 LucasXu0 merged commit 96fc5b5 into AppFlowy-IO:main Feb 18, 2024
10 of 11 checks passed
q200892907 added a commit to q200892907/appflowy-editor that referenced this pull request Feb 19, 2024
* main:
  chore: upgrade flutter version to 3.19.0 (AppFlowy-IO#719)
  fix: the positioning of the slash command menu in the web version (AppFlowy-IO#709)
  fix: unable to export image block in markdown format (AppFlowy-IO#713)
  feat: debounce on word count service (AppFlowy-IO#711)
  feat: on demand word count without listening (AppFlowy-IO#710)
  feat: support selection counters (AppFlowy-IO#706)
  feat: word counter service (AppFlowy-IO#705)
  chore: bump version 2.3.2
  chore: update Chinese i18n (AppFlowy-IO#698)
  fix: fix checkbox not work as expected in html module. (AppFlowy-IO#700)
  chore: revert ime changes (AppFlowy-IO#701)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants