Please support code beautification like for javascript
are there any alternatives for this like custom filter?


soxofaan’s picture

Status: Active » Closed (won't fix)


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: