Skip to content

Insert custom node inline in current paragraph or header #4999

Closed Answered by dan-cooke
dan-cooke asked this question in Questions & Help
Discussion options

You must be logged in to vote

Final update

I think a Mark is definetly what I was looking for. My one issue of

i don't want the user to have to highlight text in order to insert a prompt, they should be able to just hit a keyboard shortcut and have a prompt inserted

Can be resolved by having UI that is displayed when the mark is active, so its clear when they are inserting a prompt

In other words a prompt is nothing different than regular text, just with a bit of different styling

Perfect!

Heres my draft implementation for those interested

export const EmbeddedPrompt = Mark.create({
  name: 'embeddedPrompt',

  group: 'inline',

  inclusive: true,
  content: 'text*',

  addOptions() {
    return {
      HTMLAttributes

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by dan-cooke
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant