Skip to content

Commit

Permalink
detach node from DOM tree before moving it to another part of the tree
Browse files Browse the repository at this point in the history
This code is used to move table children that don't follow HTML syntax rules
  • Loading branch information
hrj committed Oct 17, 2016
1 parent ed53be9 commit 2415c72
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,7 @@ private static String applyBorders(final String template, final String dir) {
* <ul>
* <li>Table cleanup
* <ul>
* <li>elements that are not acceptable witin a table are moved before the
* table</li>
* <li>elements that are not acceptable within a table are moved before the table</li>
* </ul>
* </li>
* </ul>
Expand Down Expand Up @@ -257,6 +256,7 @@ private static void recursiveFindBadNodesInTable(final Node n, final Node cellro
}

private static void moveSubtreeBefore(final Node root, final Node ref) {
root.getParentNode().removeChild(root);
ref.getParentNode().insertBefore(root, ref);
}

Expand Down

0 comments on commit 2415c72

Please sign in to comment.