function joinTag(editor, profile, tag) {
						// empty closing slash is a nonsense for this action
						var slash = profile.selfClosing() || ' /';
						var content = tag.open.range.substring(tag.source).replace(/\s*>$/, slash + '>');

						var caretPos = editor.getCaretPos();

						// update caret position
						if (content.length + tag.outerRange.start < caretPos) {
							caretPos = content.length + tag.outerRange.start;
						}

						content = utils.escapeText(content);
						editor.replaceContent(content, tag.outerRange.start, tag.outerRange.end);
						editor.setCaretPos(caretPos);
						return true;
					}
@param {IEmmetEditor} editor
@param {Object} profile
@param {Object} tag