#277 URLModifyingVisitor duplicates various nodes in output

v1.6
open
nobody
None
5
2010-02-01
2010-02-01
Christine Chan
No

The URLModifyingVisitor duplicates text nodes and a nested node's parent.

ex 1. <p>test>/p>
becomes test<p>test</p>

ex 2. <p><b>test</b></p>
becomes test<p><b>test</b></p><p><b>test</b></p>

From what I can tell in the source code, probably what is causing the problem is:

1. line 52
public void visitStringNode(Text stringNode)
{
modifiedResult.append (stringNode.toHtml());
}

2. line 82
if (null == parent.getParent ())
// a top level tag with no parents
modifiedResult.append(parent.toHtml());

Test case is attached.

Discussion