Freezing/Locking parts of a markdown-file

Hi everyone,
I could make great use of a way to ‘freeze’ or ‘lock’ a markdown file, making only additions to the markdown file possible but never allowing to change or delete any characters that were present at a certain frozen state. I’m a JavaScript developer myself and I’d love to get something started but have never looked into the Obsidian codebase. So I was wondering if anybody had any ideas on how to approach this. I guess it’s not super easy as there’d have to be some way to track which characters are locked and which are not. Maybe you could wrap everything that is added after freezing a file in a special syntax (eg. <editable></editable>) that lets the editor know it is editable/removable. Freezing a file would then mean to remove all tags.

In case you’re wondering what my use would be: I’d love to have the normal obsidian interface for reading an epub/pdf/doc (exported to markdown) and making notes, adding annotations of various kinds to it.