markText is part of the 5.x API, EditorView suggests you’re using 6.x. I can’t quite figure out what you’re trying to do from the description, but controlling editability of specific parts of the text is now done with change filters.
Thanks for response @marijn , really appreciate. From what I know change filters are defined on initialization. I am using react as my framework and also I want to handle these on every update so the solution I am looking for should be able to work dynamically , given the document can change anytime during user interaction as user can add new lines / remove existing ones