我需要在 codemirror 编辑器中禁用语法高亮文本,因为用户可能会在编辑器中编辑某些语法,这将导致程序无法运行。那么,如何禁止语法内容的编辑呢?
例如:
在此,只有标签不应该是可编辑的,其余内容应该是可编辑的。
怎么做??
如有任何帮助,我们将不胜感激。提前致谢。
最佳答案
readOnly: boolean|string
This disables editing of the editor content by the user. If the special value "nocursor" is given (instead of simply true), focusing of the editor is also disallowed.
关于css - 如何在代码镜像编辑器中禁用语法高亮文本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27793342/