2015-10-16 20 views
0

codemirror issuecodemirror HTML混合模式沒有被應用到的JavaScript

$('.code').each(function() { 
var $this = $(this), 
$code = $this.html(); 

$this.empty(); 

var myCodeMirror = CodeMirror(this, { 
    value: $code, 
    mode: 'htmlmixed', 
    lineNumbers: false, 
    readOnly: true, 
    lineWrapping: true 
}); 

});

我使用codemirror來創建代碼片段。我有兩個問題。首先是JavaScript沒有正確着色。我已經包含了所有的依賴項(xml,css和js)。第二個是,當我將鼠標懸停在上面時,滾動會使片段稍微向上或向下移動。它不是很滾動,只是擺動。查看圖片瞭解更多詳情。

所有幫助將不勝感激。

+0

做工精細的htmlmixed模式將只強調JavaScript代碼'