I want to make a plugin or some other kind of customization that will create a new kind of link based on a pattern I give (not regular URLs). I want to decide (1) the action that is taken when these links are clicked and (2) how they’re formatted, which would be different than a regular bare link. Is that possible?
If you’re looking to define a text format that allows the editor to display it in a custom way (rendering as specific DOM elements and adding event handlers), I suggest checking out the documentation of CodeMirror editor extension. It supports custom parsing and display by defining decorations, such as using widget decorations.