}-*/;
@Override
protected void surround0(final Selection selection, final Element element) {
// get child index of selection start textNode from its parent.
final SelectionEndPoint selectionStart = this.getStart(selection);
final Text textNode = selectionStart.getTextNode();
final Element parentOfTextNode = JavaScript.getElement(textNode, PARENT_NODE);
int insertIndex = 0;
if (selectionStart.getOffset() > 0) {
insertIndex = this.getChildIndexOfTextNode(textNode) + 1;
}
// extract selection to become a child of element.
this.extract0(selection, element);