Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Commit

Permalink
Return an empty tag info for an empty space entered inside plain text.
Browse files Browse the repository at this point in the history
  • Loading branch information
RaymondLim committed Oct 17, 2012
1 parent 772fec1 commit 9294758
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/language/HTMLUtils.js
Expand Up @@ -197,6 +197,14 @@ define(function (require, exports, module) {
var offset = TokenUtils.offsetInToken(ctx);

if (!TokenUtils.moveSkippingWhitespace(TokenUtils.moveNextToken, ctx) || ctx.token.string !== "=") {
// If we're checking for a prior attribute and the next token we get is a tag or an html coment or
// an undefined token class, then we've already scanned past our original cursor location.
// So just return an empty tag info.
if (isPriorAttr &&
(!ctx.token.className ||
(ctx.token.className !== "attribute" && ctx.token.string.indexOf("<") !== -1))) {
return createTagInfo();
}
return createTagInfo(ATTR_NAME, offset, tagName, attrName);
}

Expand Down

0 comments on commit 9294758

Please sign in to comment.