【问题标题】:Ace editor enable emmet for twig modeAce 编辑器为树枝模式启用 emmet
【发布时间】:2014-09-23 09:32:17
【问题描述】:

我正在使用启用了emmet 的 Ace 编辑器。正如预期的那样,以下工作正常:

var editor = ace.edit("editor");

editor.session.setMode("ace/mode/html");
editor.setOption("enableEmmet", true);

但如果我将模式更改为:

editor.session.setMode("ace/mode/twig");

它不再起作用了。有什么方法可以让 Emmet 在ace/mode/twig 中工作?

【问题讨论】:

    标签: javascript ace-editor emmet


    【解决方案1】:

    您可以将twig 添加到https://github.com/ajaxorg/ace/blob/v1.1.5/lib/ace/ext/emmet.js#L391 的正则表达式中

    【讨论】:

    • 并不是最干净的解决方案,但是在查看了那里的源代码之后,它似乎是唯一的方法。谢谢!
    猜你喜欢
    • 2014-04-11
    • 1970-01-01
    • 2022-08-15
    • 1970-01-01
    • 1970-01-01
    • 2013-07-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多