css - 如何在代码镜像编辑器中禁用语法高亮文本?

标签 css html text syntax-highlighting codemirror

我需要在 codemirror 编辑器中禁用语法高亮文本,因为用户可能会在编辑器中编辑某些语法,这将导致程序无法运行。那么,如何禁止语法内容的编辑呢?

例如:
enter image description here

在此,只有标签不应该是可编辑的,其余内容应该是可编辑的。
怎么做??

如有任何帮助,我们将不胜感激。提前致谢。

最佳答案

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.

访问:http://codemirror.net/doc/manual.html对于文档

关于css - 如何在代码镜像编辑器中禁用语法高亮文本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27793342/

相关文章:

javascript - Accordion 不将该类应用于下一个元素

css - 不同分辨率的居中菜单

html - 段落不根据图像扩展具有灵活宽度的父容器/图像标题

html - 如何解析HTML5 Canvas中显示的数据?

html - 如何将文本限制为 div 的宽度?

javascript - 第一次打开时加载所有图片的简单图库

android - 输入文本对话框 Android

c# - 读取新闻文章实际内容并忽略页面上的 "noise"的算法?

css - DIV 从绝对位置固定

html - CSS中具有多种颜色渐变的文本