lib/action/updateTag.js
function(editor, abbr) {
			abbr = abbr || editor.prompt("Enter abbreviation");

			if (!abbr) {
				return false;
			}

			var content = editor.getContent();
			var ctx = actionUtils.captureContext(editor);
			var tag = this.getUpdatedTag(abbr, ctx, content);

			if (!tag) {
				// nothing to update
				return false;
			}

			// check if tag name was updated
			if (tag.name() != ctx.name && ctx.match.close) {
				editor.replaceContent('</' + tag.name() + '>', ctx.match.close.range.start, ctx.match.close.range.end, true);
			}

			editor.replaceContent(tag.source, ctx.match.open.range.start, ctx.match.open.range.end, true);
			return true;
		}
function(editor, abbr) {
			abbr = abbr || editor.prompt("Enter abbreviation");

			if (!abbr) {
				return false;
			}

			var content = editor.getContent();
			var ctx = actionUtils.captureContext(editor);
			var tag = this.getUpdatedTag(abbr, ctx, content);

			if (!tag) {
				// nothing to update
				return false;
			}

			// check if tag name was updated
			if (tag.name() != ctx.name && ctx.match.close) {
				editor.replaceContent('</' + tag.name() + '>', ctx.match.close.range.start, ctx.match.close.range.end, true);
			}

			editor.replaceContent(tag.source, ctx.match.open.range.start, ctx.match.open.range.end, true);
			return true;
		}
function ( editor , abbr ) { abbr = abbr || editor . prompt ( "Enter abbreviation" ) ; if ( ! abbr ) { return false ; } var content = editor . getContent ( ) ; var ctx = actionUtils . captureContext ( editor ) ; var tag = this . getUpdatedTag ( abbr , ctx , content ) ; if ( ! tag ) { // nothing to update return false ; } // check if tag name was updated if ( tag . name ( ) != ctx . name && ctx . match . close ) { editor . replaceContent ( '</' + tag . name ( ) + '>' , ctx . match . close . range . start , ctx . match . close . range . end , true ) ; } editor . replaceContent ( tag . source , ctx . match . open . range . start , ctx . match . open . range . end , true ) ; return true ; }
Matches HTML tag under caret and updates its definition
according to given abbreviation
@param {IEmmetEditor} Editor instance
@param {String} abbr Abbreviation to update with
Matches HTML tag under caret and updates its definition according to given abbreviation