Thursday, January 26, 2012

Encode and format my code for blog post

This is the code formatter for my preferred style,

effect:
encode special char '<', '>', '"' and '&'
change 'tab' to space x 4
color comment line/block (starts with '//' or '/*') to dark green
color doc block (starts with '/**' or '<!--') to dark blue
no break line, has horizontal scroll bar

** tested at blogger and chrome only :)





Download: The source is at github https://github.com/benbai123/HTML_CSS_Javascript_practice/blob/master/simple_code_formatter.html

No comments:

Post a Comment