作者热门文章
- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我正在使用 ACE 编辑器在我的网页上显示 xml 内容。我想在编辑器中格式化 xml 代码。
谁能告诉我怎么做?
最佳答案
Ace 本身并未指定 XML 代码格式,因为它只是一个编辑器。使用 this question 中的任何答案美化代码。
var code = ace.getSession().getValue();
// prettify
ace.getSession().setValue(code);
关于javascript - 如何在 Ace Editor 中格式化 XML 代码?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10753543/
我是一名优秀的程序员,十分优秀!