-
Notifications
You must be signed in to change notification settings - Fork 117
fix(ui-markdown-editor): handle cut image operation - #294 #298
Conversation
@@ -130,10 +129,15 @@ export const MarkdownEditor = (props) => { | |||
const CICERO_MARK_DOM = slateTransformer.toCiceroMark(SLATE_DOM); | |||
const HTML_DOM = htmlTransformer.toHtml(CICERO_MARK_DOM); | |||
const MARKDOWN_TEXT = ciceroMarkTransformer.toMarkdown(CICERO_MARK_DOM); | |||
const [imageNode] = Editor.nodes(editor, { match: n => n.type === 'image' }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@irmerk @DianaLease @dselman Is this the best way to detect if the operation applies to an 'image'?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@irmerk @DianaLease @dselman Also tell me the best way to detect textnode.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have precedent here for detecting an image, see L175 under handleDrop
in this file.
I'd look for other inspiration on a text node.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@irmerk Sure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good spot @Cronus1007. I'm happy with the change, but will need a review from one of the maintainers with deeper knowledge of Slate to confirm.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me. Can you rebase to get rid of 1c6ee38?
Signed-off-by: Cronus1007 <lit2019058@iiitl.ac.in>
fix(ui-markdown-editor): handle cut image operation - accordproject#294 (accordproject#298)
Closes #294
The Cut operation that can't be performed upon the images is regulated.
Steps to see the Change
Screenshots or Video
Related Issues
Author Checklist
--signoff
option of git commit.master
fromfork:branchname