Please support code beautification like http://jsbeautifier.org/ for javascript
are there any alternatives for this like custom filter?

Comments

soxofaan’s picture

Status: Active » Closed (won't fix)

hi,

I'm afraid jsbeautifier and the GeSHi filter module are hard to match/combine for several reasons.
* The GeSHi filter processes and formats the source code server side (in PHP), while jsbeautifier is primarly meant to be run client side (javascript). Client side, after GeSHi filtering, the source code is heavily transformed to make the syntax highlighting work, so before jsbeatifier can do its job, it needs to decode all this again.
* jsbeautifier's website mentions that it can be run server side, but this requires a server side setup that is not typical for most drupal sites I guess. Apart from this, integrating it with Drupal in PHP will be non trivial and I don't have the resources to do let alone support this.
* Jsbeatifier only supports processing of javascript code as far as I could determine, while the GeSHi filter module supports more than 170 languages at the time of this writing.

Maybe you'll have more luck at one of the syntax highlighting alternatives:
http://drupal.org/project/syntaxhighlighter
http://drupal.org/project/chili_highlighter
http://drupal.org/project/ajax_markup