A simple marker?

Hi guys, I am trying to create a simple marker based on the code hints given about migrating from CM 5 to 6. I have created a CodePen with my source https://codepen.io/js_experiments/pen/dyZrezM?editors=1000

Any idea what I am doing wrong? I am not getting any errors, the highlight is simply not happening. I don’t know if this has to do with adding the extension not at initialisation? In my case, I’d like to add this to an existing editor instance. Can you give me any pointers on how to accomplish this?

You seem to be defining markField but never doing anything with it. Add it to your state’s extensions to actually enable it for your editor.

Thanks @marijn, that worked! A quick follow-up question, any idea why this would work in the CodePen, but not in another CM6 editor instance in the web? Could this be because the web editor instance was created with a different minor version of the CM6 lib?