Disable plugin on condition

Hi, I have made a plugin that initializes marks on paragraph and headings via appendTransaction However, when I paste something in my editor, I don’t these marks to be initialized, instead I want it to use the default font when not found, else use the same font as the pasted text. Any leads as to where I should look at? I have made a handlePaste plugin, but how to stop the appendTransaction from taking place

I have looked at this :

But still am not able to figure out what can be done. Thanks again for your help

I don’t understand well enough what you are trying to do to say much here. What criteria does your appendTransaction method use to determine which content to change? Can you formulate the changes in such a way that they automatically do the right thing for paste transactions?

My appendTransaction method is just initializing marks on text and paragraph nodes, similar to this:

Now when I paste, this plugin makes everything initialize with default marks, which I don’t want.

I can possibly formulate the changes if there is a paste transaction. How do I get to know if a transaction is a paste event or not?

Thanks :slight_smile:

That was somewhat hard – you could register a handlePaste property and create your own transaction with some kind of tag, but with this commit that I just added you can simply inspect tr.getMeta("paste").