如何使用CodeMirror突出显示类似C的代码?

时间:2018-11-29 15:29:25

标签: codemirror

我正在使用codeMirror突出显示C程序代码。我按照官方文档进行配置:

$(".cCodeMirror").each(function(){
  var cEditor = CodeMirror.fromTextArea($(this)[0], {
         lineNumbers: true,
         matchBrackets: true,
         mode: "text/x-csrc",
         readOnly: true,
         styleActiveLine: true,
         theme: "eclipse"
       });
});

但是我可以看到如下代码: enter image description here

请注意,不会突出显示语法,例如int关键字看起来是纯文本,printf()函数是纯文本,等等。我想念什么?这是实时网址:here

有什么想法吗?

相关问题