/StackOverflowCodeIndent

Indents your highlighted code on StackOverflow.com and similar StackExchange sites

Primary LanguageJavaScriptMIT LicenseMIT

StackOverflowCodeIndent

Indents your highlighted code on StackOverflow.com and similar StackExchange sites.

After reading a question on meta.stackoverflow.com (http://meta.stackoverflow.com/questions/266253/indentation-feature) I felt the pain of Oliver (http://meta.stackoverflow.com/users/1022330/oliver-watkins) as I too have wished for such a feature!

I've used StackOverflow since it was in beta and often find that I'm copying/pasting code into the textarea provided after whipping it up in my editor.

When added to the textarea it is always "flush" with the left margin... and the code is often internally indented with tabs.

In order for the code to be recognized and formatted properly on StackOverflow it needs to be indented with 4 spaces as that is what Markdown expects.

Even when hand coding on the site adding the first 4 spaces is easy but for every line of code it gets insanely frustrating.

This tool runs as a Bookmarklet in your browser - just highlight your code and click it for instant Markdown code indentation! ;-)