在记事本++或类似文件中用一行写的缩进JavaScript代码

Gia*_*971 72 javascript notepad++ indentation text-indent

我有一些javascript代码写在一行(没有回车),它是完全不可读的...用记事本++,我试图自己替换这些字符("{","}",";")+一个马车返回,但它仍然不是很方便...

如果有人能帮助我,那将非常感激.

PS我宁愿帮助用notepad ++做这个,但不介意使用任何其他软件包

Qua*_*inh 149

JSTool是稳定性最好的.

步骤:

  1. 选择菜单插件>插件管理器>显示插件管理器
  2. 选中JSTool复选框>安装>重新启动Notepad ++
  3. 打开js文件>插件> JSTool> JSFormat
    截图

参考:

  • 真棒..它的工作.你也可以离线使用它.再见JS美化 (2认同)

Rya*_*rty 61

我想你想要一个代码美化器,这个看起来快速简单:http: //jsbeautifier.org/


Sun*_*wen 51

尝试使用notepad ++插件JSMinNpp(自1.15以来将名称更改为JSTool)

http://www.sunjw.us/jsminnpp/


小智 7

使用jsbeautifier而不是尝试手动执行.


Sam*_*lgh 7

你可以使用像在线服务这样

更新:(根据要求)

Google Chrome也会这样做http://cristian-radulescu.ro/article/pretty-print-javascript-with-google-chrome.html

  • 唉,也挨打了吧。对不起。Google Chrome 也会这样做 http://cristian-radulescu.ro/article/pretty-print-javascript-with-google-chrome.html (2认同)