Menu

#11 Newlines not parsed correctly

open
nobody
5
2010-08-17
2010-08-17
Ravi Arora
No

Consider this string (without quotes):

"<html><head><title>Hi I am jake</title></head>\n\n\n<body><p div=\"id\">What!</p></body></html>"

I print the dom tree. For the three newlines in between the positions of the newlines in the output are given as 5@[46;49)
This is counting only two newlines. The positions of the rest of the elements is also given incorrect.

Here is the source: http://pastebin.com/WvF7Cm91
Here is the output:

-----
0@[0;90)
1@[0;90) html
2@[6;46) head
3@[12;39) title
4@[19;31) Hi I am jake
5@[46;49)

6@[49;83) body
7@[55;76) p
8@[67;72) What!
-----

Discussion

  • Davi de Castro Reis

    This looks correct. Which output did you expect?

     
  • Ravi Arora

    Ravi Arora - 2011-02-14

    I expect it to be 5@[46;50)

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.