We don’t allow questions seeking recommendations for software libraries, tutorials, tools, books, or other off-site resources. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(4)
布莱恩·阿格纽的链接应该可以正常工作。我还可以推荐独立的 Polystyle(不过售价 15 美元)。
顺便说一句,您最好先获取 TinyMCE 的非缩小版本并使用它。一些缩小器不仅删除换行符,还更改变量名称和其他代码元素。
Brian Agnew's link should work fine. There's also the standalone Polystyle which I can recommend (costs $15 though).
On a side note, it may be better for you to get the non-minified version of TinyMCE and work with that in the first place. Some minifiers not only remove line breaks, but change variables names and other code elements as well.
大多数 JavaScript 引擎都会美化函数。知道了这一点,这里有一个函数可以帮助您解决问题:
如果您使用
function.toString(-1)
,SpiderMonkey 和 Rhino 也可以取消美化(缩小)它们,以防您需要做相反的事情。我也有一个功能:编辑:看来你只需要为tinymce.js 执行此操作。您可以下载TinyMCE源代码,因为它是开源的。
Most JavaScript engines beautify functions. Knowing this, here is a function that can help you with your problem:
SpiderMonkey and Rhino can also un-beautify (minify) them if you use
function.toString(-1)
in case you ever need to do the opposite. I also have a function for that too:Edit: It seems you only need to do this for tinymce.js. You can download the TinyMCE source code as it's open source.
大多数现代浏览器中集成的开发人员工具能够清理格式。作为示例,下面的动画 GIF 展示了如何在 Microsoft Edge 中实现此目的:
两者都存在类似的功能 Chrome 和 Firefox 也是如此。
还有在线解决方案如果您想复制/粘贴一大块缩小的代码。
The developer tools, integrated in most modern browsers, are capable of cleaning up the formatting. As an example, below is an animated GIF showing how you can achieve this in Microsoft Edge:
Similar functionality exists for both Chrome, and Firefox as well.
There are also online solutions if you want to copy/paste a large block of minified code.
另请看一下:http://closure-compiler.appspot.com/home ;一个谷歌工具。
在格式下选择[漂亮打印]
Also take a look at this: http://closure-compiler.appspot.com/home; A Google tool.
Choose [Pretty print] under Formatting