docs: function displayWithStructure(element) {
          var txt = element.textContent || "";
          var selection = document.getSelection();
          if (txt.length === 0 || !selection || selection.rangeCount <= 0) {
              element.dispatchEvent(event);
              return;
          }
          
          var range = selection.getRangeAt(0);
          var tempRange = range.cloneRange(), startNode, startOffset;
          startNode = range.startContainer;
          startOffset = range.startOffset;
          var textOffset = 0;
          if (startNode.nodeType === 3) {
              textOffset += startOffset;
          }
          tempRange.setStart(element,0);
          tempRange.setEndBefore(startNode);
          var div = document.createElement('div');
          div.appendChild(tempRange.cloneContents());
          textOffset += div.textContent.length;
  
          element.innerHTML = getHandler(element.getAttribute("data-tf-type")).
              format(txt, JSON.parse(element.getAttribute("data-tf-args")), (element.getAttribute("data-tf-dir") === "true"? true : false),
              true, element.getAttribute("data-tf-locale"));
          var parent = element;
          var node = element;
          var newOffset = 0;
          var inEnd = false;
          selection.removeAllRanges();
          range.setStart(element,0);
          range.setEnd(element,0);
          while (node) {
              if (node.nodeType === 3) {
                  if (newOffset + node.nodeValue.length >= textOffset) {
                      range.setStart(node, textOffset - newOffset);
                      break;
                  }
                  else {
                      newOffset += node.nodeValue.length;
                      node = node.nextSibling;
                  }
              }
              else if(node.hasChildNodes()) {
                  parent = node;
                  node = parent.firstChild;
                  continue;
              }
              else {
                  node = node.nextSibling;
              }
              while (!node) {
                  if (parent === element) {
                      inEnd = true;
                      break;
                  }
                  node = parent.nextSibling;
                  parent = parent.parentNode;
              }
              if (inEnd) {
                  break;
              }
          }
  
          selection.addRange(range);
          element.dispatchEvent(event);
      }