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

Commit

Permalink
Minor fixes after review
Browse files Browse the repository at this point in the history
  • Loading branch information
WebsiteDeveloper committed Apr 20, 2013
1 parent f50e376 commit 53cbe28
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/language/HTMLUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -400,12 +400,12 @@ define(function (require, exports, module) {
return createTagInfo();
}

// Check to see if this is the closing of a tag (either the start or end) self closing tag
// Check to see if this is the closing of a start tag or a self closing tag
if (ctx.token.string === ">" || ctx.token.string === "/>") {
return createTagInfo();
}

// Check to see if this is the closing of a tag (either the start or end) closing tag
// Check to see if this is a closing tag
if (ctx.token.string.charAt(0) === "<" && ctx.token.string.charAt(1) === "/") {
return createTagInfo(CLOSING_TAG, offset - 2, ctx.token.string.slice(2));
}
Expand Down
20 changes: 10 additions & 10 deletions test/spec/CodeHintUtils-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,16 +186,6 @@ define(function (require, exports, module) {
expect(tag).toEqual(HTMLUtils.createTagInfo(HTMLUtils.TAG_NAME));
});

it("should not hint anything inside a closing tag", function () {
var pos = {"ch": 0, "line": 0};
setContentAndUpdatePos(pos,
["<html>", "<body>", "<div id='test' class='foo'></div>"],
"</body></ht", "ml>");

var tag = HTMLUtils.getTagInfo(myEditor, pos);
expect(tag).toEqual(HTMLUtils.createTagInfo(HTMLUtils.CLOSING_TAG, 2, "html"));
});

it("should find the tagname of the current tag if two tags are right next to each other", function () {
var pos = {"ch": 0, "line": 0};
setContentAndUpdatePos(pos,
Expand Down Expand Up @@ -247,6 +237,16 @@ define(function (require, exports, module) {
expect(tag).toEqual(HTMLUtils.createTagInfo());
});

it("should not hint anything inside a closing tag", function () {
var pos = {"ch": 0, "line": 0};
setContentAndUpdatePos(pos,
["<html>", "<body>", "<div id='test' class='foo'></div>"],
"</body></ht", "ml>");

var tag = HTMLUtils.getTagInfo(myEditor, pos);
expect(tag).toEqual(HTMLUtils.createTagInfo(HTMLUtils.CLOSING_TAG, 2, "html"));
});

it("should not find attributes in an empty editor", function () {
var pos = {"ch": 0, "line": 0};
var attrs = HTMLUtils.getTagAttributes(myEditor, pos);
Expand Down

0 comments on commit 53cbe28

Please sign in to comment.