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

Add support for inline image in markdown editor by drag and drop of an image file #4006

Merged

Conversation

HiroyasuNishiyama
Copy link
Member

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Proposed changes

This PR adds inline figure support to the markdown editor of Node-RED editor used for describing node's as documents discussed at this forum thread.

  • inserting an inline image as data URL () by drag & drop of an image file.

This PR is one of two features included in the previous PR.

画面収録 2023-01-05 16 19 46

Checklist

  • I have read the contribution guidelines
  • For non-bugfix PRs, I have discussed this change on the forum/slack team.
  • I have run grunt to verify the unit tests pass
  • I have added suitable unit tests to cover the new/changed functionality

@coveralls
Copy link

coveralls commented Jan 5, 2023

Coverage Status

Coverage: 68.241% (-0.005%) from 68.246% when pulling e7540de on node-red-hitachi:add-markdown-image-drag-and-drop into 928131c on node-red:dev.

@knolleary
Copy link
Member

Looks good.

Do you think we should put some limits in place based on file extension and/or size?

If a user starts dropping in lots of 1+Mb images then they could quickly hit API payload size limits. Also, the file type - we should probably limit to png/jpeg/gif.

@HiroyasuNishiyama
Copy link
Member Author

Do you think we should put some limits in place based on file extension and/or size?

If a user starts dropping in lots of 1+Mb images then they could quickly hit API payload size limits.

Considering that multiple images can be used in a flow, I think it can be difficult to determine the maximum size of droppable image file.

Also, the file type - we should probably limit to png/jpeg/gif.

According to this page, apng, avif, svg, and webp are other candidates.
I will update the code to prevent uploading unexpected file type.

@knolleary knolleary merged commit e7540de into node-red:dev Feb 2, 2023
@knolleary
Copy link
Member

Had to remove package-lock.json that had accidentally slipped in - but otherwise looks great

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

3 participants