Skip to content
Advertisement

Removing leading whitespace from indented HTML source in pre/code tags

I currently have the following html within a pre-code block:

JavaScript

It is indented within the html source for better structure within the document. How can I remove the leading whitespace? Through the use of javascript or is there a more simple method.

Advertisement

Answer

You may want to just change how it is output, but it is fairly simple to do with JavaScript

JavaScript

http://jsfiddle.net/a4gfZ/

Advertisement