In vs2008, the support for JavaScript formatting is extremely poor, and it has suffered a lot. Program Share with you!
The Code is as follows:
Code
<! Doctype HTML public "-// W3C // dtd xhtml 1.0 transitional // en" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
< Html Xmlns = "Http://www.w3.org/1999/xhtml" >
< Head >
< Title > Untitled page </ Title >
</ Head >
< Body >
<ScriptType= "Text/JavaScript">
Function Js_beauter (js_source_text, indent_size, indent_character, indent_level)
{
VaR Input, output, token_text, last_type, last_text, last_word, current_mode, modes, indent_string;
VaR Whitespace, wordchar, punct, parser_pos, line_starters, in_case;
VaR Prefix, token_type, do_block_just_closed, var_line, var_line_tainted, if_line_flag;
Function Trim_output ()
{
While (Output. Length && (Output [output. Length - 1 ] === ' ' | Output [output. Length - 1 ] === Indent_string )){
Output. Pop ();
}
}
Function Print_newline (ignore_repeated)
{
Ignore_repeated = Typeof Ignore_repeated === ' Undefined ' ? True : Ignore_repeated;
If_line_fla