Skip to content

Feature: Hide image in editor #3163

Answered by acywatson
miag676 asked this question in Q&A
Discussion options

You must be logged in to vote

Yea, you can render anything you want - you can just insert a LinkNode instead of an ImageNode.

Here's some pseudocode:

editor.registerCommand('INSERT_IMAGE_COMMAND',(payload) => {
  const link = $createLinkNode(payload.href);
  const text = $createTextNode('My Image');
  link.append(text);
  selection.insertNodes([link]);
})

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@miag676
Comment options

Answer selected by thegreatercurve
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
enhancement Improvement over existing feature
2 participants
Converted from issue

This discussion was converted from issue #3148 on October 12, 2022 09:40.