Skip to content

parser javascript quote state problem #1

@GoogleCodeExporter

Description

@GoogleCodeExporter
What steps will reproduce the problem?
1. source code:
int main(void){
    unsigned int getchar_ret;
    htmlparser_ctx *parser = htmlparser_new();
    int js_stat = 0;    
    while((getchar_ret = getchar()) != EOF){
        char c = (char)getchar_ret;
        htmlparser_parse_chr(parser, c);
  if (parser->in_js == 1) { 
    putchar(c);
    js_stat = htmlparser_js_state(parser);
        printf("js stat is %d\n",js_stat);
        }       
    else{   
//  putchar(c);
    }
    }
}
2. Input:
<script type="text/javascript"> 
  document.write("<img src='www.example.com' border=0 width=0 height=0>");
</script>
3. The parser state of string"<img src='www.example.com' border=0 width=0 
height=0>" is 2(JSPARSER_STATE_DQ).

What is the expected output? What do you see instead?
The parser state of string 'www.example.com' expect to be 1(JSPARSER_STATE_Q).

What version of the product are you using? On what operating system?

Version:0.1
OS: linux FC5

Please provide any additional information below.


Original issue reported on code.google.com by zbo...@gmail.com on 10 Jan 2011 at 10:15

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions