rickysarraf / foxreplace

Automatically exported from code.google.com/p/foxreplace
0 stars 0 forks source link

Strange <a> tag behavior #77

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Got to "http://www.anaesthetist.com/mnm/javascript/calc.htm"
2. Replace "<a name="
3. With "Online<a name="
4. Use Text mode

What is the expected output? 
just three <A> anchors predicated with "online" BEFORE them
What do you see instead?
All <A> tags, <li> tags and <p> tags for about half of the page get 'online' 
AFTER them.

What version of the product are you using? On what operating system?
FoxReplace 0.12.2
FireFox 3.6.28
XP Sp3

Please provide any additional information below.
Also does this on the search for <a name="plan"> Which should one Match ONCE. 
However this version stops at the next '<a name=' entry (which is <a 
name="table">) that's the first <a> tag not to match.

The plain "<a name=" version stops half way down the page at again the first 
non-matching <a> tag, which is <a href="#table">

It does not hit every tag as things like <b> <ul> <ol> and all Table related 
tags are ignored.

For easy reproduction I've included a xml of the replacement and the page is 
here: http://www.anaesthetist.com/mnm/javascript/calc.htm

Original issue reported on code.google.com by mpheyse%...@gtempaccount.com on 14 Jul 2012 at 3:58

Attachments:

GoogleCodeExporter commented 9 years ago
It's working correctly according to the DOM tree. If you just use "View source" 
you see the original HTML source which contains only a few <a name> tags. But 
if you see the source corresponding to the DOM tree (select a part or all the 
page and "View soure from selection") you will see that that there ara in fact 
a lot more <a name> tags, because they have been duplicated several times (I 
don't know why). Since FoxReplace works on the DOM tree, the result is the one 
you see.

Original comment by marc.r...@gmail.com on 15 Jul 2012 at 1:32