Hello everyone. Not sure if the post really belongs here, but I’ll try.
So, I need to make a plugin that will check the number of links in a post or page while being in editor. I understood that Gutenberg was built using React, so I used the JS Mutation Observer to watch for any content edit. And it turned out that Gutenberg makes three mutations to insert a hyperlink. So I made an array to filter out the duplicates by inserting mutation targets into it and then check against it.
I think there is a better way to do what I’d written, but how? Did anybody have a similar task? If so, please help.