outdent.js
An experiment to detect and remove extraneous leading whitespace from multiline strings, especially for HTML code.
Only tested in latest Firefox, Safari and Chrome (in 2014). Fair warning: this was a personal experiment, might be unstable and have subpar performance.
Documentation
There isn’t much. See this article for an introduction, and look at the outdent.js file directly.
Running the demo page
The demo can be run using PHP’s built-in development server:
php --server localhost:8000
Then open http://localhost:8000/demo.php in your browser of choice.