如何为ace编辑器设置css3 + svg语言模式

时间:2019-01-16 11:40:28

标签: css3 svg ace-editor

我想要一个编辑器的css3和svg验证。 我尝试过这种方式,但是这里不能使用两种语言模式

$scope.aceHtml = {
    mode: 'css',
    useWrapMode: true,
    maxLines: 20,
    onChange: aceChange
}

function aceChange(_editor) {
    $scope.isContenthasError = false;
    _editor[1].getSession().on('changeAnnotation', function () {
        var annot = _editor[1].getSession().getAnnotations();
        if (annot.length > 0) {
            for (var key in annot) {
                if (annot.hasOwnProperty(key))
                    if (annot[key].type === 'error') {
                        $scope.isContenthasError = true;
                        $scope.annot = annot;
                    }
            }
        }
    });
};

0 个答案:

没有答案
相关问题